Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef __cplusplus
571 : #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
572 : #endif
573 : #ifndef CYTHON_INLINE
574 : #if defined(__clang__)
575 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
576 : #else
577 : #define CYTHON_INLINE inline
578 : #endif
579 : #endif
580 : template<typename T>
581 6345 : void __Pyx_call_destructor(T& x) {
582 6345 : x.~T();
583 : }
584 : template<typename T>
585 : class __Pyx_FakeReference {
586 : public:
587 : __Pyx_FakeReference() : ptr(NULL) { }
588 : __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
589 : T *operator->() { return ptr; }
590 : T *operator&() { return ptr; }
591 : operator T&() { return *ptr; }
592 : template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
593 : template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
594 : template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
595 : template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
596 : private:
597 : T *ptr;
598 : };
599 :
600 : #define __PYX_BUILD_PY_SSIZE_T "n"
601 : #define CYTHON_FORMAT_SSIZE_T "z"
602 : #if PY_MAJOR_VERSION < 3
603 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
604 : #define __Pyx_DefaultClassType PyClass_Type
605 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
606 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
607 : #else
608 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
609 : #define __Pyx_DefaultClassType PyType_Type
610 : #if CYTHON_COMPILING_IN_LIMITED_API
611 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
612 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
613 : PyObject *fv, PyObject *cell, PyObject* fn,
614 : PyObject *name, int fline, PyObject *lnos) {
615 : PyObject *exception_table = NULL;
616 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
617 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
618 : PyObject *version_info;
619 : PyObject *py_minor_version = NULL;
620 : #endif
621 : long minor_version = 0;
622 : PyObject *type, *value, *traceback;
623 : PyErr_Fetch(&type, &value, &traceback);
624 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
625 : minor_version = 11;
626 : #else
627 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
628 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
629 : minor_version = PyLong_AsLong(py_minor_version);
630 : Py_DECREF(py_minor_version);
631 : if (minor_version == -1 && PyErr_Occurred()) goto end;
632 : #endif
633 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
634 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
635 : if (minor_version <= 7) {
636 : (void)p;
637 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
638 : c, n, v, fn, name, fline, lnos, fv, cell);
639 : } else if (minor_version <= 10) {
640 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
641 : c, n, v, fn, name, fline, lnos, fv, cell);
642 : } else {
643 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
644 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
645 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
646 : }
647 : end:
648 : Py_XDECREF(code_type);
649 : Py_XDECREF(exception_table);
650 : Py_XDECREF(types_module);
651 : if (type) {
652 : PyErr_Restore(type, value, traceback);
653 : }
654 : return result;
655 : }
656 : #ifndef CO_OPTIMIZED
657 : #define CO_OPTIMIZED 0x0001
658 : #endif
659 : #ifndef CO_NEWLOCALS
660 : #define CO_NEWLOCALS 0x0002
661 : #endif
662 : #ifndef CO_VARARGS
663 : #define CO_VARARGS 0x0004
664 : #endif
665 : #ifndef CO_VARKEYWORDS
666 : #define CO_VARKEYWORDS 0x0008
667 : #endif
668 : #ifndef CO_ASYNC_GENERATOR
669 : #define CO_ASYNC_GENERATOR 0x0200
670 : #endif
671 : #ifndef CO_GENERATOR
672 : #define CO_GENERATOR 0x0020
673 : #endif
674 : #ifndef CO_COROUTINE
675 : #define CO_COROUTINE 0x0080
676 : #endif
677 : #elif PY_VERSION_HEX >= 0x030B0000
678 2 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
679 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
680 : PyObject *fv, PyObject *cell, PyObject* fn,
681 : PyObject *name, int fline, PyObject *lnos) {
682 2 : PyCodeObject *result;
683 2 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
684 2 : if (!empty_bytes) return NULL;
685 2 : result =
686 : #if PY_VERSION_HEX >= 0x030C0000
687 : PyUnstable_Code_NewWithPosOnlyArgs
688 : #else
689 : PyCode_NewWithPosOnlyArgs
690 : #endif
691 2 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
692 2 : Py_DECREF(empty_bytes);
693 : return result;
694 : }
695 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
696 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
697 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
698 : #else
699 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
700 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
701 : #endif
702 : #endif
703 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
704 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
705 : #else
706 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
707 : #endif
708 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
709 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
710 : #else
711 : #define __Pyx_Py_Is(x, y) ((x) == (y))
712 : #endif
713 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
714 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
715 : #else
716 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
717 : #endif
718 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
719 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
720 : #else
721 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
722 : #endif
723 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
724 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
725 : #else
726 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
727 : #endif
728 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
729 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
730 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
731 : #else
732 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
733 : #endif
734 : #ifndef CO_COROUTINE
735 : #define CO_COROUTINE 0x80
736 : #endif
737 : #ifndef CO_ASYNC_GENERATOR
738 : #define CO_ASYNC_GENERATOR 0x200
739 : #endif
740 : #ifndef Py_TPFLAGS_CHECKTYPES
741 : #define Py_TPFLAGS_CHECKTYPES 0
742 : #endif
743 : #ifndef Py_TPFLAGS_HAVE_INDEX
744 : #define Py_TPFLAGS_HAVE_INDEX 0
745 : #endif
746 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
747 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
748 : #endif
749 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
750 : #define Py_TPFLAGS_HAVE_FINALIZE 0
751 : #endif
752 : #ifndef Py_TPFLAGS_SEQUENCE
753 : #define Py_TPFLAGS_SEQUENCE 0
754 : #endif
755 : #ifndef Py_TPFLAGS_MAPPING
756 : #define Py_TPFLAGS_MAPPING 0
757 : #endif
758 : #ifndef METH_STACKLESS
759 : #define METH_STACKLESS 0
760 : #endif
761 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
762 : #ifndef METH_FASTCALL
763 : #define METH_FASTCALL 0x80
764 : #endif
765 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
766 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
767 : Py_ssize_t nargs, PyObject *kwnames);
768 : #else
769 : #if PY_VERSION_HEX >= 0x030d00A4
770 : # define __Pyx_PyCFunctionFast PyCFunctionFast
771 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
772 : #else
773 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
774 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
775 : #endif
776 : #endif
777 : #if CYTHON_METH_FASTCALL
778 : #define __Pyx_METH_FASTCALL METH_FASTCALL
779 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
780 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
781 : #else
782 : #define __Pyx_METH_FASTCALL METH_VARARGS
783 : #define __Pyx_PyCFunction_FastCall PyCFunction
784 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
785 : #endif
786 : #if CYTHON_VECTORCALL
787 : #define __pyx_vectorcallfunc vectorcallfunc
788 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
789 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
790 : #elif CYTHON_BACKPORT_VECTORCALL
791 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
792 : size_t nargsf, PyObject *kwnames);
793 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
794 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
795 : #else
796 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
797 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
798 : #endif
799 : #if PY_MAJOR_VERSION >= 0x030900B1
800 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
801 : #else
802 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
803 : #endif
804 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
805 : #if CYTHON_COMPILING_IN_CPYTHON
806 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
807 : #elif !CYTHON_COMPILING_IN_LIMITED_API
808 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
809 : #endif
810 : #if CYTHON_COMPILING_IN_CPYTHON
811 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
812 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
813 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
814 : }
815 : #endif
816 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
817 : #if CYTHON_COMPILING_IN_LIMITED_API
818 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
819 : #else
820 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
821 : #endif
822 : }
823 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
824 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
825 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
826 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
827 : #else
828 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
829 : #define __Pyx_PyCMethod PyCMethod
830 : #endif
831 : #ifndef METH_METHOD
832 : #define METH_METHOD 0x200
833 : #endif
834 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
835 : #define PyObject_Malloc(s) PyMem_Malloc(s)
836 : #define PyObject_Free(p) PyMem_Free(p)
837 : #define PyObject_Realloc(p) PyMem_Realloc(p)
838 : #endif
839 : #if CYTHON_COMPILING_IN_LIMITED_API
840 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
841 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
842 : #else
843 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
844 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
845 : #endif
846 : #if CYTHON_COMPILING_IN_LIMITED_API
847 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
848 : #elif !CYTHON_FAST_THREAD_STATE
849 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
850 : #elif PY_VERSION_HEX >= 0x030d00A1
851 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
852 : #elif PY_VERSION_HEX >= 0x03060000
853 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
854 : #elif PY_VERSION_HEX >= 0x03000000
855 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
856 : #else
857 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
858 : #endif
859 : #if CYTHON_COMPILING_IN_LIMITED_API
860 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
861 : {
862 : void *result;
863 : result = PyModule_GetState(op);
864 : if (!result)
865 : Py_FatalError("Couldn't find the module state");
866 : return result;
867 : }
868 : #endif
869 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
870 : #if CYTHON_COMPILING_IN_LIMITED_API
871 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
872 : #else
873 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
874 : #endif
875 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
876 : #include "pythread.h"
877 : #define Py_tss_NEEDS_INIT 0
878 : typedef int Py_tss_t;
879 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
880 : *key = PyThread_create_key();
881 : return 0;
882 : }
883 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
884 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
885 : *key = Py_tss_NEEDS_INIT;
886 : return key;
887 : }
888 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
889 : PyObject_Free(key);
890 : }
891 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
892 : return *key != Py_tss_NEEDS_INIT;
893 : }
894 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
895 : PyThread_delete_key(*key);
896 : *key = Py_tss_NEEDS_INIT;
897 : }
898 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
899 : return PyThread_set_key_value(*key, value);
900 : }
901 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
902 : return PyThread_get_key_value(*key);
903 : }
904 : #endif
905 : #if PY_MAJOR_VERSION < 3
906 : #if CYTHON_COMPILING_IN_PYPY
907 : #if PYPY_VERSION_NUM < 0x07030600
908 : #if defined(__cplusplus) && __cplusplus >= 201402L
909 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
910 : #elif defined(__GNUC__) || defined(__clang__)
911 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
912 : #elif defined(_MSC_VER)
913 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
914 : #endif
915 : static CYTHON_INLINE int PyGILState_Check(void) {
916 : return 0;
917 : }
918 : #else // PYPY_VERSION_NUM < 0x07030600
919 : #endif // PYPY_VERSION_NUM < 0x07030600
920 : #else
921 : static CYTHON_INLINE int PyGILState_Check(void) {
922 : PyThreadState * tstate = _PyThreadState_Current;
923 : return tstate && (tstate == PyGILState_GetThisThreadState());
924 : }
925 : #endif
926 : #endif
927 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
928 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
929 : #else
930 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
931 : #endif
932 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
933 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
934 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
935 : #else
936 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
937 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
938 : #endif
939 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
940 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
941 0 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
942 0 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
943 0 : if (res == NULL) PyErr_Clear();
944 0 : return res;
945 : }
946 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
947 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
948 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
949 : #else
950 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
951 : #if CYTHON_COMPILING_IN_PYPY
952 : return PyDict_GetItem(dict, name);
953 : #else
954 : PyDictEntry *ep;
955 : PyDictObject *mp = (PyDictObject*) dict;
956 : long hash = ((PyStringObject *) name)->ob_shash;
957 : assert(hash != -1);
958 : ep = (mp->ma_lookup)(mp, name, hash);
959 : if (ep == NULL) {
960 : return NULL;
961 : }
962 : return ep->me_value;
963 : #endif
964 : }
965 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
966 : #endif
967 : #if CYTHON_USE_TYPE_SLOTS
968 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
969 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
970 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
971 : #else
972 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
973 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
974 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
975 : #endif
976 : #if CYTHON_COMPILING_IN_LIMITED_API
977 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
978 : #else
979 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
980 : #endif
981 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
982 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
983 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
984 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
985 : PyObject_GC_Del(obj);\
986 : Py_DECREF(type);\
987 : }
988 : #else
989 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
990 : #endif
991 : #if CYTHON_COMPILING_IN_LIMITED_API
992 : #define CYTHON_PEP393_ENABLED 1
993 : #define __Pyx_PyUnicode_READY(op) (0)
994 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
995 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
996 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
997 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
998 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
999 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
1000 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
1001 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
1002 : #define CYTHON_PEP393_ENABLED 1
1003 : #if PY_VERSION_HEX >= 0x030C0000
1004 : #define __Pyx_PyUnicode_READY(op) (0)
1005 : #else
1006 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
1007 : 0 : _PyUnicode_Ready((PyObject *)(op)))
1008 : #endif
1009 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
1010 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
1011 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
1012 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
1013 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
1014 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
1015 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1016 : #if PY_VERSION_HEX >= 0x030C0000
1017 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1018 : #else
1019 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1020 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1021 : #else
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1023 : #endif
1024 : #endif
1025 : #else
1026 : #define CYTHON_PEP393_ENABLED 0
1027 : #define PyUnicode_1BYTE_KIND 1
1028 : #define PyUnicode_2BYTE_KIND 2
1029 : #define PyUnicode_4BYTE_KIND 4
1030 : #define __Pyx_PyUnicode_READY(op) (0)
1031 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1032 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1033 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1034 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1035 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1036 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1037 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1038 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1039 : #endif
1040 : #if CYTHON_COMPILING_IN_PYPY
1041 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1042 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1043 : #else
1044 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1045 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1046 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1047 : #endif
1048 : #if CYTHON_COMPILING_IN_PYPY
1049 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1050 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1051 : #endif
1052 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1053 : #undef PyUnicode_Contains
1054 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1055 : #endif
1056 : #if !defined(PyByteArray_Check)
1057 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1058 : #endif
1059 : #if !defined(PyObject_Format)
1060 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1061 : #endif
1062 : #endif
1063 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1064 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1065 : #if PY_MAJOR_VERSION >= 3
1066 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1067 : #else
1068 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1069 : #endif
1070 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1071 : #define PyObject_ASCII(o) PyObject_Repr(o)
1072 : #endif
1073 : #if PY_MAJOR_VERSION >= 3
1074 : #define PyBaseString_Type PyUnicode_Type
1075 : #define PyStringObject PyUnicodeObject
1076 : #define PyString_Type PyUnicode_Type
1077 : #define PyString_Check PyUnicode_Check
1078 : #define PyString_CheckExact PyUnicode_CheckExact
1079 : #ifndef PyObject_Unicode
1080 : #define PyObject_Unicode PyObject_Str
1081 : #endif
1082 : #endif
1083 : #if PY_MAJOR_VERSION >= 3
1084 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1085 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1086 : #else
1087 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1088 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1089 : #endif
1090 : #if CYTHON_COMPILING_IN_CPYTHON
1091 : #define __Pyx_PySequence_ListKeepNew(obj)\
1092 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1093 : #else
1094 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1095 : #endif
1096 : #ifndef PySet_CheckExact
1097 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1098 : #endif
1099 : #if PY_VERSION_HEX >= 0x030900A4
1100 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1101 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1102 : #else
1103 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1104 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1105 : #endif
1106 : #if CYTHON_ASSUME_SAFE_MACROS
1107 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1108 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1109 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1110 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1111 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1112 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1113 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1114 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1115 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1116 : #else
1117 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1118 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1119 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1120 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1121 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1122 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1123 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1124 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1125 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1126 : #endif
1127 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1128 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1129 : #else
1130 3 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1131 3 : PyObject *module = PyImport_AddModule(name);
1132 3 : Py_XINCREF(module);
1133 3 : return module;
1134 : }
1135 : #endif
1136 : #if PY_MAJOR_VERSION >= 3
1137 : #define PyIntObject PyLongObject
1138 : #define PyInt_Type PyLong_Type
1139 : #define PyInt_Check(op) PyLong_Check(op)
1140 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1141 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1142 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1143 : #define PyInt_FromString PyLong_FromString
1144 : #define PyInt_FromUnicode PyLong_FromUnicode
1145 : #define PyInt_FromLong PyLong_FromLong
1146 : #define PyInt_FromSize_t PyLong_FromSize_t
1147 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1148 : #define PyInt_AsLong PyLong_AsLong
1149 : #define PyInt_AS_LONG PyLong_AS_LONG
1150 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1151 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1152 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1153 : #define PyNumber_Int PyNumber_Long
1154 : #else
1155 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1156 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1157 : #endif
1158 : #if PY_MAJOR_VERSION >= 3
1159 : #define PyBoolObject PyLongObject
1160 : #endif
1161 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1162 : #ifndef PyUnicode_InternFromString
1163 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1164 : #endif
1165 : #endif
1166 : #if PY_VERSION_HEX < 0x030200A4
1167 : typedef long Py_hash_t;
1168 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1169 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1170 : #else
1171 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1172 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1173 : #endif
1174 : #if CYTHON_USE_ASYNC_SLOTS
1175 : #if PY_VERSION_HEX >= 0x030500B1
1176 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1177 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1178 : #else
1179 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1180 : #endif
1181 : #else
1182 : #define __Pyx_PyType_AsAsync(obj) NULL
1183 : #endif
1184 : #ifndef __Pyx_PyAsyncMethodsStruct
1185 : typedef struct {
1186 : unaryfunc am_await;
1187 : unaryfunc am_aiter;
1188 : unaryfunc am_anext;
1189 : } __Pyx_PyAsyncMethodsStruct;
1190 : #endif
1191 :
1192 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1193 : #if !defined(_USE_MATH_DEFINES)
1194 : #define _USE_MATH_DEFINES
1195 : #endif
1196 : #endif
1197 : #include <math.h>
1198 : #ifdef NAN
1199 : #define __PYX_NAN() ((float) NAN)
1200 : #else
1201 : static CYTHON_INLINE float __PYX_NAN() {
1202 : float value;
1203 : memset(&value, 0xFF, sizeof(value));
1204 : return value;
1205 : }
1206 : #endif
1207 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1208 : #define __Pyx_truncl trunc
1209 : #else
1210 : #define __Pyx_truncl truncl
1211 : #endif
1212 :
1213 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1214 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1215 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1216 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1217 :
1218 : #ifdef CYTHON_EXTERN_C
1219 : #undef __PYX_EXTERN_C
1220 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1221 : #elif defined(__PYX_EXTERN_C)
1222 : #ifdef _MSC_VER
1223 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1224 : #else
1225 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1226 : #endif
1227 : #else
1228 : #define __PYX_EXTERN_C extern "C++"
1229 : #endif
1230 :
1231 : #define __PYX_HAVE__scipy__optimize___highs__cython__src___highs_wrapper
1232 : #define __PYX_HAVE_API__scipy__optimize___highs__cython__src___highs_wrapper
1233 : /* Early includes */
1234 : #include <string.h>
1235 : #include <stdio.h>
1236 :
1237 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1238 :
1239 : #include "numpy/arrayobject.h"
1240 : #include "numpy/ndarrayobject.h"
1241 : #include "numpy/ndarraytypes.h"
1242 : #include "numpy/arrayscalars.h"
1243 : #include "numpy/ufuncobject.h"
1244 : #include <string>
1245 : #include "ios"
1246 : #include "new"
1247 : #include "stdexcept"
1248 : #include "typeinfo"
1249 : #include <utility>
1250 :
1251 : #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
1252 : // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
1253 : #include <type_traits>
1254 :
1255 : namespace cython_std {
1256 : template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
1257 : template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
1258 : }
1259 :
1260 : #endif
1261 :
1262 : #include <map>
1263 : #include "HConst.h"
1264 : #include "HighsStatus.h"
1265 : #include <vector>
1266 : #include "HighsOptions.h"
1267 : #include "HighsInfo.h"
1268 : #include "HighsSparseMatrix.h"
1269 : #include "HighsLp.h"
1270 : #include "Highs.h"
1271 : #include "HighsModelUtils.h"
1272 : #include "pythread.h"
1273 : #include <stdlib.h>
1274 : #ifdef _OPENMP
1275 : #include <omp.h>
1276 : #endif /* _OPENMP */
1277 :
1278 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1279 : #define CYTHON_WITHOUT_ASSERTIONS
1280 : #endif
1281 :
1282 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1283 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1284 :
1285 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1286 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1287 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1288 : #define __PYX_DEFAULT_STRING_ENCODING ""
1289 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1290 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1291 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1292 : #define __Pyx_long_cast(x) ((long)x)
1293 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1294 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1295 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1296 : likely(v < (type)PY_SSIZE_T_MAX ||\
1297 : v == (type)PY_SSIZE_T_MAX) &&\
1298 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1299 : v == (type)PY_SSIZE_T_MIN))) ||\
1300 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1301 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1302 : v == (type)PY_SSIZE_T_MAX))) )
1303 2796 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1304 2796 : return (size_t) i < (size_t) limit;
1305 : }
1306 : #if defined (__cplusplus) && __cplusplus >= 201103L
1307 : #include <cstdlib>
1308 : #define __Pyx_sst_abs(value) std::abs(value)
1309 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1310 : #define __Pyx_sst_abs(value) abs(value)
1311 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1312 : #define __Pyx_sst_abs(value) labs(value)
1313 : #elif defined (_MSC_VER)
1314 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1315 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1316 : #define __Pyx_sst_abs(value) llabs(value)
1317 : #elif defined (__GNUC__)
1318 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1319 : #else
1320 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1321 : #endif
1322 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1323 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1324 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1325 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1326 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1327 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1328 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1329 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1330 : #if PY_MAJOR_VERSION < 3
1331 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1332 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1333 : #else
1334 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1335 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1336 : #endif
1337 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1338 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1339 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1340 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1341 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1342 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1343 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1344 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1345 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1346 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1347 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1348 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1349 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1350 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1351 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1352 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1353 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1354 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1355 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1356 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1357 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1358 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1359 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1360 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1361 : #define __Pyx_PySequence_Tuple(obj)\
1362 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1363 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1364 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1365 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1366 : #if CYTHON_ASSUME_SAFE_MACROS
1367 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1368 : #else
1369 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1370 : #endif
1371 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1372 : #if PY_MAJOR_VERSION >= 3
1373 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1374 : #else
1375 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1376 : #endif
1377 : #if CYTHON_USE_PYLONG_INTERNALS
1378 : #if PY_VERSION_HEX >= 0x030C00A7
1379 : #ifndef _PyLong_SIGN_MASK
1380 : #define _PyLong_SIGN_MASK 3
1381 : #endif
1382 : #ifndef _PyLong_NON_SIZE_BITS
1383 : #define _PyLong_NON_SIZE_BITS 3
1384 : #endif
1385 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1386 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1387 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1388 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1389 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1390 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1391 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1392 : #define __Pyx_PyLong_SignedDigitCount(x)\
1393 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1394 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1395 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1396 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1397 : #else
1398 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1399 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1400 : #endif
1401 : typedef Py_ssize_t __Pyx_compact_pylong;
1402 : typedef size_t __Pyx_compact_upylong;
1403 : #else
1404 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1405 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1406 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1407 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1408 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1409 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1410 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1411 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1412 : #define __Pyx_PyLong_CompactValue(x)\
1413 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1414 : typedef sdigit __Pyx_compact_pylong;
1415 : typedef digit __Pyx_compact_upylong;
1416 : #endif
1417 : #if PY_VERSION_HEX >= 0x030C00A5
1418 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1419 : #else
1420 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1421 : #endif
1422 : #endif
1423 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1424 : #include <string.h>
1425 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1426 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1427 : PyObject* sys;
1428 : PyObject* default_encoding = NULL;
1429 : PyObject* ascii_chars_u = NULL;
1430 : PyObject* ascii_chars_b = NULL;
1431 : const char* default_encoding_c;
1432 : sys = PyImport_ImportModule("sys");
1433 : if (!sys) goto bad;
1434 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1435 : Py_DECREF(sys);
1436 : if (!default_encoding) goto bad;
1437 : default_encoding_c = PyBytes_AsString(default_encoding);
1438 : if (!default_encoding_c) goto bad;
1439 : if (strcmp(default_encoding_c, "ascii") == 0) {
1440 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1441 : } else {
1442 : char ascii_chars[128];
1443 : int c;
1444 : for (c = 0; c < 128; c++) {
1445 : ascii_chars[c] = (char) c;
1446 : }
1447 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1448 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1449 : if (!ascii_chars_u) goto bad;
1450 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1451 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1452 : PyErr_Format(
1453 : PyExc_ValueError,
1454 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1455 : default_encoding_c);
1456 : goto bad;
1457 : }
1458 : Py_DECREF(ascii_chars_u);
1459 : Py_DECREF(ascii_chars_b);
1460 : }
1461 : Py_DECREF(default_encoding);
1462 : return 0;
1463 : bad:
1464 : Py_XDECREF(default_encoding);
1465 : Py_XDECREF(ascii_chars_u);
1466 : Py_XDECREF(ascii_chars_b);
1467 : return -1;
1468 : }
1469 : #endif
1470 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1471 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1472 : #else
1473 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1474 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1475 : #include <string.h>
1476 : static char* __PYX_DEFAULT_STRING_ENCODING;
1477 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1478 : PyObject* sys;
1479 : PyObject* default_encoding = NULL;
1480 : char* default_encoding_c;
1481 : sys = PyImport_ImportModule("sys");
1482 : if (!sys) goto bad;
1483 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1484 : Py_DECREF(sys);
1485 : if (!default_encoding) goto bad;
1486 : default_encoding_c = PyBytes_AsString(default_encoding);
1487 : if (!default_encoding_c) goto bad;
1488 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1489 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1490 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1491 : Py_DECREF(default_encoding);
1492 : return 0;
1493 : bad:
1494 : Py_XDECREF(default_encoding);
1495 : return -1;
1496 : }
1497 : #endif
1498 : #endif
1499 :
1500 :
1501 : /* Test for GCC > 2.95 */
1502 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1503 : #define likely(x) __builtin_expect(!!(x), 1)
1504 : #define unlikely(x) __builtin_expect(!!(x), 0)
1505 : #else /* !__GNUC__ or GCC < 2.95 */
1506 : #define likely(x) (x)
1507 : #define unlikely(x) (x)
1508 : #endif /* __GNUC__ */
1509 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1510 :
1511 : #if !CYTHON_USE_MODULE_STATE
1512 : static PyObject *__pyx_m = NULL;
1513 : #endif
1514 : static int __pyx_lineno;
1515 : static int __pyx_clineno = 0;
1516 : static const char * __pyx_cfilenm = __FILE__;
1517 : static const char *__pyx_filename;
1518 :
1519 : /* Header.proto */
1520 : #if !defined(CYTHON_CCOMPLEX)
1521 : #if defined(__cplusplus)
1522 : #define CYTHON_CCOMPLEX 1
1523 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1524 : #define CYTHON_CCOMPLEX 1
1525 : #else
1526 : #define CYTHON_CCOMPLEX 0
1527 : #endif
1528 : #endif
1529 : #if CYTHON_CCOMPLEX
1530 : #ifdef __cplusplus
1531 : #include <complex>
1532 : #else
1533 : #include <complex.h>
1534 : #endif
1535 : #endif
1536 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1537 : #undef _Complex_I
1538 : #define _Complex_I 1.0fj
1539 : #endif
1540 :
1541 : /* #### Code section: filename_table ### */
1542 :
1543 : static const char *__pyx_f[] = {
1544 : "_highs_wrapper.pyx",
1545 : "<stringsource>",
1546 : "__init__.cython-30.pxd",
1547 : "type.pxd",
1548 : };
1549 : /* #### Code section: utility_code_proto_before_types ### */
1550 : /* ForceInitThreads.proto */
1551 : #ifndef __PYX_FORCE_INIT_THREADS
1552 : #define __PYX_FORCE_INIT_THREADS 0
1553 : #endif
1554 :
1555 : /* NoFastGil.proto */
1556 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1557 : #define __Pyx_PyGILState_Release PyGILState_Release
1558 : #define __Pyx_FastGIL_Remember()
1559 : #define __Pyx_FastGIL_Forget()
1560 : #define __Pyx_FastGilFuncInit()
1561 :
1562 : /* BufferFormatStructs.proto */
1563 : struct __Pyx_StructField_;
1564 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1565 : typedef struct {
1566 : const char* name;
1567 : struct __Pyx_StructField_* fields;
1568 : size_t size;
1569 : size_t arraysize[8];
1570 : int ndim;
1571 : char typegroup;
1572 : char is_unsigned;
1573 : int flags;
1574 : } __Pyx_TypeInfo;
1575 : typedef struct __Pyx_StructField_ {
1576 : __Pyx_TypeInfo* type;
1577 : const char* name;
1578 : size_t offset;
1579 : } __Pyx_StructField;
1580 : typedef struct {
1581 : __Pyx_StructField* field;
1582 : size_t parent_offset;
1583 : } __Pyx_BufFmt_StackElem;
1584 : typedef struct {
1585 : __Pyx_StructField root;
1586 : __Pyx_BufFmt_StackElem* head;
1587 : size_t fmt_offset;
1588 : size_t new_count, enc_count;
1589 : size_t struct_alignment;
1590 : int is_complex;
1591 : char enc_type;
1592 : char new_packmode;
1593 : char enc_packmode;
1594 : char is_valid_array;
1595 : } __Pyx_BufFmt_Context;
1596 :
1597 : /* Atomics.proto */
1598 : #include <pythread.h>
1599 : #ifndef CYTHON_ATOMICS
1600 : #define CYTHON_ATOMICS 1
1601 : #endif
1602 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1603 : #define __pyx_atomic_int_type int
1604 : #define __pyx_nonatomic_int_type int
1605 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1606 : (__STDC_VERSION__ >= 201112L) &&\
1607 : !defined(__STDC_NO_ATOMICS__))
1608 : #include <stdatomic.h>
1609 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1610 : (__cplusplus >= 201103L) ||\
1611 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1612 : #include <atomic>
1613 : #endif
1614 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1615 : (__STDC_VERSION__ >= 201112L) &&\
1616 : !defined(__STDC_NO_ATOMICS__) &&\
1617 : ATOMIC_INT_LOCK_FREE == 2)
1618 : #undef __pyx_atomic_int_type
1619 : #define __pyx_atomic_int_type atomic_int
1620 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1621 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1622 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1623 : #pragma message ("Using standard C atomics")
1624 : #elif defined(__PYX_DEBUG_ATOMICS)
1625 : #warning "Using standard C atomics"
1626 : #endif
1627 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1628 : (__cplusplus >= 201103L) ||\
1629 : \
1630 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1631 : ATOMIC_INT_LOCK_FREE == 2)
1632 : #undef __pyx_atomic_int_type
1633 : #define __pyx_atomic_int_type std::atomic_int
1634 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1635 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1636 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1637 : #pragma message ("Using standard C++ atomics")
1638 : #elif defined(__PYX_DEBUG_ATOMICS)
1639 : #warning "Using standard C++ atomics"
1640 : #endif
1641 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1642 : (__GNUC_MINOR__ > 1 ||\
1643 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1644 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1645 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1646 : #ifdef __PYX_DEBUG_ATOMICS
1647 : #warning "Using GNU atomics"
1648 : #endif
1649 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1650 : #include <intrin.h>
1651 : #undef __pyx_atomic_int_type
1652 : #define __pyx_atomic_int_type long
1653 : #undef __pyx_nonatomic_int_type
1654 : #define __pyx_nonatomic_int_type long
1655 : #pragma intrinsic (_InterlockedExchangeAdd)
1656 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1657 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1658 : #ifdef __PYX_DEBUG_ATOMICS
1659 : #pragma message ("Using MSVC atomics")
1660 : #endif
1661 : #else
1662 : #undef CYTHON_ATOMICS
1663 : #define CYTHON_ATOMICS 0
1664 : #ifdef __PYX_DEBUG_ATOMICS
1665 : #warning "Not using atomics"
1666 : #endif
1667 : #endif
1668 : #if CYTHON_ATOMICS
1669 : #define __pyx_add_acquisition_count(memview)\
1670 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1671 : #define __pyx_sub_acquisition_count(memview)\
1672 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1673 : #else
1674 : #define __pyx_add_acquisition_count(memview)\
1675 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1676 : #define __pyx_sub_acquisition_count(memview)\
1677 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1678 : #endif
1679 :
1680 : /* MemviewSliceStruct.proto */
1681 : struct __pyx_memoryview_obj;
1682 : typedef struct {
1683 : struct __pyx_memoryview_obj *memview;
1684 : char *data;
1685 : Py_ssize_t shape[8];
1686 : Py_ssize_t strides[8];
1687 : Py_ssize_t suboffsets[8];
1688 : } __Pyx_memviewslice;
1689 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1690 :
1691 : /* #### Code section: numeric_typedefs ### */
1692 :
1693 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1694 : * # in Cython to enable them only on the right systems.
1695 : *
1696 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1697 : * ctypedef npy_int16 int16_t
1698 : * ctypedef npy_int32 int32_t
1699 : */
1700 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1701 :
1702 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1703 : *
1704 : * ctypedef npy_int8 int8_t
1705 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1706 : * ctypedef npy_int32 int32_t
1707 : * ctypedef npy_int64 int64_t
1708 : */
1709 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1710 :
1711 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1712 : * ctypedef npy_int8 int8_t
1713 : * ctypedef npy_int16 int16_t
1714 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1715 : * ctypedef npy_int64 int64_t
1716 : * #ctypedef npy_int96 int96_t
1717 : */
1718 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1719 :
1720 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1721 : * ctypedef npy_int16 int16_t
1722 : * ctypedef npy_int32 int32_t
1723 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1724 : * #ctypedef npy_int96 int96_t
1725 : * #ctypedef npy_int128 int128_t
1726 : */
1727 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1728 :
1729 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1730 : * #ctypedef npy_int128 int128_t
1731 : *
1732 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1733 : * ctypedef npy_uint16 uint16_t
1734 : * ctypedef npy_uint32 uint32_t
1735 : */
1736 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1737 :
1738 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1739 : *
1740 : * ctypedef npy_uint8 uint8_t
1741 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1742 : * ctypedef npy_uint32 uint32_t
1743 : * ctypedef npy_uint64 uint64_t
1744 : */
1745 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1746 :
1747 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1748 : * ctypedef npy_uint8 uint8_t
1749 : * ctypedef npy_uint16 uint16_t
1750 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1751 : * ctypedef npy_uint64 uint64_t
1752 : * #ctypedef npy_uint96 uint96_t
1753 : */
1754 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1755 :
1756 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1757 : * ctypedef npy_uint16 uint16_t
1758 : * ctypedef npy_uint32 uint32_t
1759 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1760 : * #ctypedef npy_uint96 uint96_t
1761 : * #ctypedef npy_uint128 uint128_t
1762 : */
1763 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1764 :
1765 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1766 : * #ctypedef npy_uint128 uint128_t
1767 : *
1768 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1769 : * ctypedef npy_float64 float64_t
1770 : * #ctypedef npy_float80 float80_t
1771 : */
1772 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1773 :
1774 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1775 : *
1776 : * ctypedef npy_float32 float32_t
1777 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1778 : * #ctypedef npy_float80 float80_t
1779 : * #ctypedef npy_float128 float128_t
1780 : */
1781 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1782 :
1783 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1784 : * ctypedef double complex complex128_t
1785 : *
1786 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1787 : * ctypedef npy_ulonglong ulonglong_t
1788 : *
1789 : */
1790 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1791 :
1792 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1793 : *
1794 : * ctypedef npy_longlong longlong_t
1795 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1796 : *
1797 : * ctypedef npy_intp intp_t
1798 : */
1799 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1800 :
1801 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1802 : * ctypedef npy_ulonglong ulonglong_t
1803 : *
1804 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1805 : * ctypedef npy_uintp uintp_t
1806 : *
1807 : */
1808 : typedef npy_intp __pyx_t_5numpy_intp_t;
1809 :
1810 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1811 : *
1812 : * ctypedef npy_intp intp_t
1813 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1814 : *
1815 : * ctypedef npy_double float_t
1816 : */
1817 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1818 :
1819 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1820 : * ctypedef npy_uintp uintp_t
1821 : *
1822 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1823 : * ctypedef npy_double double_t
1824 : * ctypedef npy_longdouble longdouble_t
1825 : */
1826 : typedef npy_double __pyx_t_5numpy_float_t;
1827 :
1828 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1829 : *
1830 : * ctypedef npy_double float_t
1831 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1832 : * ctypedef npy_longdouble longdouble_t
1833 : *
1834 : */
1835 : typedef npy_double __pyx_t_5numpy_double_t;
1836 :
1837 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1838 : * ctypedef npy_double float_t
1839 : * ctypedef npy_double double_t
1840 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1841 : *
1842 : * ctypedef float complex cfloat_t
1843 : */
1844 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1845 : /* #### Code section: complex_type_declarations ### */
1846 : /* Declarations.proto */
1847 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1848 : #ifdef __cplusplus
1849 : typedef ::std::complex< float > __pyx_t_float_complex;
1850 : #else
1851 : typedef float _Complex __pyx_t_float_complex;
1852 : #endif
1853 : #else
1854 : typedef struct { float real, imag; } __pyx_t_float_complex;
1855 : #endif
1856 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1857 :
1858 : /* Declarations.proto */
1859 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1860 : #ifdef __cplusplus
1861 : typedef ::std::complex< double > __pyx_t_double_complex;
1862 : #else
1863 : typedef double _Complex __pyx_t_double_complex;
1864 : #endif
1865 : #else
1866 : typedef struct { double real, imag; } __pyx_t_double_complex;
1867 : #endif
1868 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1869 :
1870 : /* Declarations.proto */
1871 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1872 : #ifdef __cplusplus
1873 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1874 : #else
1875 : typedef long double _Complex __pyx_t_long_double_complex;
1876 : #endif
1877 : #else
1878 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1879 : #endif
1880 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1881 :
1882 : /* #### Code section: type_declarations ### */
1883 :
1884 : /*--- Type declarations ---*/
1885 : struct __pyx_array_obj;
1886 : struct __pyx_MemviewEnum_obj;
1887 : struct __pyx_memoryview_obj;
1888 : struct __pyx_memoryviewslice_obj;
1889 :
1890 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1891 : *
1892 : * # Iterator API added in v1.6
1893 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1894 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1895 : *
1896 : */
1897 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1898 :
1899 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1900 : * # Iterator API added in v1.6
1901 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1902 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1903 : *
1904 : * cdef extern from "numpy/arrayobject.h":
1905 : */
1906 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1907 : struct __pyx_opt_args_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning;
1908 :
1909 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":70
1910 : *
1911 : *
1912 : * cdef str _opt_warning(string name, val, valid_set=None): # <<<<<<<<<<<<<<
1913 : * cdef OptionRecord * r = _ref_opt_lookup[name]
1914 : *
1915 : */
1916 : struct __pyx_opt_args_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning {
1917 : int __pyx_n;
1918 : PyObject *valid_set;
1919 : };
1920 :
1921 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":235
1922 : *
1923 : *
1924 : * ctypedef HighsVarType* HighsVarType_ptr # <<<<<<<<<<<<<<
1925 : *
1926 : *
1927 : */
1928 : typedef HighsVarType *__pyx_t_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_HighsVarType_ptr;
1929 :
1930 : /* "View.MemoryView":114
1931 : * @cython.collection_type("sequence")
1932 : * @cname("__pyx_array")
1933 : * cdef class array: # <<<<<<<<<<<<<<
1934 : *
1935 : * cdef:
1936 : */
1937 : struct __pyx_array_obj {
1938 : PyObject_HEAD
1939 : struct __pyx_vtabstruct_array *__pyx_vtab;
1940 : char *data;
1941 : Py_ssize_t len;
1942 : char *format;
1943 : int ndim;
1944 : Py_ssize_t *_shape;
1945 : Py_ssize_t *_strides;
1946 : Py_ssize_t itemsize;
1947 : PyObject *mode;
1948 : PyObject *_format;
1949 : void (*callback_free_data)(void *);
1950 : int free_data;
1951 : int dtype_is_object;
1952 : };
1953 :
1954 :
1955 : /* "View.MemoryView":302
1956 : *
1957 : * @cname('__pyx_MemviewEnum')
1958 : * cdef class Enum(object): # <<<<<<<<<<<<<<
1959 : * cdef object name
1960 : * def __init__(self, name):
1961 : */
1962 : struct __pyx_MemviewEnum_obj {
1963 : PyObject_HEAD
1964 : PyObject *name;
1965 : };
1966 :
1967 :
1968 : /* "View.MemoryView":337
1969 : *
1970 : * @cname('__pyx_memoryview')
1971 : * cdef class memoryview: # <<<<<<<<<<<<<<
1972 : *
1973 : * cdef object obj
1974 : */
1975 : struct __pyx_memoryview_obj {
1976 : PyObject_HEAD
1977 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1978 : PyObject *obj;
1979 : PyObject *_size;
1980 : PyObject *_array_interface;
1981 : PyThread_type_lock lock;
1982 : __pyx_atomic_int_type acquisition_count;
1983 : Py_buffer view;
1984 : int flags;
1985 : int dtype_is_object;
1986 : __Pyx_TypeInfo *typeinfo;
1987 : };
1988 :
1989 :
1990 : /* "View.MemoryView":952
1991 : * @cython.collection_type("sequence")
1992 : * @cname('__pyx_memoryviewslice')
1993 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1994 : * "Internal class for passing memoryview slices to Python"
1995 : *
1996 : */
1997 : struct __pyx_memoryviewslice_obj {
1998 : struct __pyx_memoryview_obj __pyx_base;
1999 : __Pyx_memviewslice from_slice;
2000 : PyObject *from_object;
2001 : PyObject *(*to_object_func)(char *);
2002 : int (*to_dtype_func)(char *, PyObject *);
2003 : };
2004 :
2005 :
2006 :
2007 : /* "View.MemoryView":114
2008 : * @cython.collection_type("sequence")
2009 : * @cname("__pyx_array")
2010 : * cdef class array: # <<<<<<<<<<<<<<
2011 : *
2012 : * cdef:
2013 : */
2014 :
2015 : struct __pyx_vtabstruct_array {
2016 : PyObject *(*get_memview)(struct __pyx_array_obj *);
2017 : };
2018 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2019 :
2020 :
2021 : /* "View.MemoryView":337
2022 : *
2023 : * @cname('__pyx_memoryview')
2024 : * cdef class memoryview: # <<<<<<<<<<<<<<
2025 : *
2026 : * cdef object obj
2027 : */
2028 :
2029 : struct __pyx_vtabstruct_memoryview {
2030 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2031 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2032 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2033 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2034 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2035 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2036 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2037 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2038 : };
2039 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2040 :
2041 :
2042 : /* "View.MemoryView":952
2043 : * @cython.collection_type("sequence")
2044 : * @cname('__pyx_memoryviewslice')
2045 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2046 : * "Internal class for passing memoryview slices to Python"
2047 : *
2048 : */
2049 :
2050 : struct __pyx_vtabstruct__memoryviewslice {
2051 : struct __pyx_vtabstruct_memoryview __pyx_base;
2052 : };
2053 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2054 : /* #### Code section: utility_code_proto ### */
2055 :
2056 : /* --- Runtime support code (head) --- */
2057 : /* Refnanny.proto */
2058 : #ifndef CYTHON_REFNANNY
2059 : #define CYTHON_REFNANNY 0
2060 : #endif
2061 : #if CYTHON_REFNANNY
2062 : typedef struct {
2063 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2064 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2065 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2066 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2067 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2068 : void (*FinishContext)(void**);
2069 : } __Pyx_RefNannyAPIStruct;
2070 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2071 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2072 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2073 : #ifdef WITH_THREAD
2074 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2075 : if (acquire_gil) {\
2076 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2077 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2078 : PyGILState_Release(__pyx_gilstate_save);\
2079 : } else {\
2080 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2081 : }
2082 : #define __Pyx_RefNannyFinishContextNogil() {\
2083 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2084 : __Pyx_RefNannyFinishContext();\
2085 : PyGILState_Release(__pyx_gilstate_save);\
2086 : }
2087 : #else
2088 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2089 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2090 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2091 : #endif
2092 : #define __Pyx_RefNannyFinishContextNogil() {\
2093 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2094 : __Pyx_RefNannyFinishContext();\
2095 : PyGILState_Release(__pyx_gilstate_save);\
2096 : }
2097 : #define __Pyx_RefNannyFinishContext()\
2098 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2099 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2100 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2101 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2102 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2103 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2104 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2105 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2106 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2107 : #else
2108 : #define __Pyx_RefNannyDeclarations
2109 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2110 : #define __Pyx_RefNannyFinishContextNogil()
2111 : #define __Pyx_RefNannyFinishContext()
2112 : #define __Pyx_INCREF(r) Py_INCREF(r)
2113 : #define __Pyx_DECREF(r) Py_DECREF(r)
2114 : #define __Pyx_GOTREF(r)
2115 : #define __Pyx_GIVEREF(r)
2116 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2117 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2118 : #define __Pyx_XGOTREF(r)
2119 : #define __Pyx_XGIVEREF(r)
2120 : #endif
2121 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2122 : PyObject *tmp = (PyObject *) r;\
2123 : r = v; Py_XDECREF(tmp);\
2124 : } while (0)
2125 : #define __Pyx_XDECREF_SET(r, v) do {\
2126 : PyObject *tmp = (PyObject *) r;\
2127 : r = v; __Pyx_XDECREF(tmp);\
2128 : } while (0)
2129 : #define __Pyx_DECREF_SET(r, v) do {\
2130 : PyObject *tmp = (PyObject *) r;\
2131 : r = v; __Pyx_DECREF(tmp);\
2132 : } while (0)
2133 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2134 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2135 :
2136 : /* PyErrExceptionMatches.proto */
2137 : #if CYTHON_FAST_THREAD_STATE
2138 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2139 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2140 : #else
2141 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2142 : #endif
2143 :
2144 : /* PyThreadStateGet.proto */
2145 : #if CYTHON_FAST_THREAD_STATE
2146 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2147 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2148 : #if PY_VERSION_HEX >= 0x030C00A6
2149 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2150 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2151 : #else
2152 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2153 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2154 : #endif
2155 : #else
2156 : #define __Pyx_PyThreadState_declare
2157 : #define __Pyx_PyThreadState_assign
2158 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2159 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2160 : #endif
2161 :
2162 : /* PyErrFetchRestore.proto */
2163 : #if CYTHON_FAST_THREAD_STATE
2164 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2165 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2166 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2167 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2168 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2169 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2170 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2171 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2172 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2173 : #else
2174 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2175 : #endif
2176 : #else
2177 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2178 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2179 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2180 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2181 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2182 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2183 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2184 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2185 : #endif
2186 :
2187 : /* PyObjectGetAttrStr.proto */
2188 : #if CYTHON_USE_TYPE_SLOTS
2189 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2190 : #else
2191 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2192 : #endif
2193 :
2194 : /* PyObjectGetAttrStrNoError.proto */
2195 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2196 :
2197 : /* GetBuiltinName.proto */
2198 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2199 :
2200 : /* TupleAndListFromArray.proto */
2201 : #if CYTHON_COMPILING_IN_CPYTHON
2202 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2203 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2204 : #endif
2205 :
2206 : /* IncludeStringH.proto */
2207 : #include <string.h>
2208 :
2209 : /* BytesEquals.proto */
2210 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2211 :
2212 : /* UnicodeEquals.proto */
2213 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2214 :
2215 : /* fastcall.proto */
2216 : #if CYTHON_AVOID_BORROWED_REFS
2217 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2218 : #elif CYTHON_ASSUME_SAFE_MACROS
2219 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2220 : #else
2221 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2222 : #endif
2223 : #if CYTHON_AVOID_BORROWED_REFS
2224 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2225 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2226 : #else
2227 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2228 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2229 : #endif
2230 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2231 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2232 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2233 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2234 : #if CYTHON_METH_FASTCALL
2235 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2236 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2237 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2238 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2239 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2240 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2241 : #else
2242 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2243 : #endif
2244 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2245 : to have the same reference counting */
2246 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2247 : #else
2248 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2249 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2250 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2251 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2252 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2253 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2254 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2255 : #endif
2256 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2257 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2258 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2259 : #else
2260 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2261 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2262 : #endif
2263 :
2264 : /* RaiseArgTupleInvalid.proto */
2265 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2266 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2267 :
2268 : /* RaiseDoubleKeywords.proto */
2269 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2270 :
2271 : /* ParseKeywords.proto */
2272 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2273 : PyObject **argnames[],
2274 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2275 : const char* function_name);
2276 :
2277 : /* ArgTypeTest.proto */
2278 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2279 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2280 : __Pyx__ArgTypeTest(obj, type, name, exact))
2281 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2282 :
2283 : /* RaiseException.proto */
2284 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2285 :
2286 : /* PyFunctionFastCall.proto */
2287 : #if CYTHON_FAST_PYCALL
2288 : #if !CYTHON_VECTORCALL
2289 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2290 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2291 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2292 : #endif
2293 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2294 : (sizeof(char [1 - 2*!(cond)]) - 1)
2295 : #ifndef Py_MEMBER_SIZE
2296 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2297 : #endif
2298 : #if !CYTHON_VECTORCALL
2299 : #if PY_VERSION_HEX >= 0x03080000
2300 : #include "frameobject.h"
2301 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2302 : #ifndef Py_BUILD_CORE
2303 : #define Py_BUILD_CORE 1
2304 : #endif
2305 : #include "internal/pycore_frame.h"
2306 : #endif
2307 : #define __Pxy_PyFrame_Initialize_Offsets()
2308 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2309 : #else
2310 : static size_t __pyx_pyframe_localsplus_offset = 0;
2311 : #include "frameobject.h"
2312 : #define __Pxy_PyFrame_Initialize_Offsets()\
2313 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2314 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2315 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2316 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2317 : #endif
2318 : #endif
2319 : #endif
2320 :
2321 : /* PyObjectCall.proto */
2322 : #if CYTHON_COMPILING_IN_CPYTHON
2323 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2324 : #else
2325 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2326 : #endif
2327 :
2328 : /* PyObjectCallMethO.proto */
2329 : #if CYTHON_COMPILING_IN_CPYTHON
2330 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2331 : #endif
2332 :
2333 : /* PyObjectFastCall.proto */
2334 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2335 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2336 :
2337 : /* RaiseUnexpectedTypeError.proto */
2338 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2339 :
2340 : /* GCCDiagnostics.proto */
2341 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2342 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2343 : #endif
2344 :
2345 : /* BuildPyUnicode.proto */
2346 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2347 : int prepend_sign, char padding_char);
2348 :
2349 : /* CIntToPyUnicode.proto */
2350 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2351 :
2352 : /* CIntToPyUnicode.proto */
2353 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2354 :
2355 : /* JoinPyUnicode.proto */
2356 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2357 : Py_UCS4 max_char);
2358 :
2359 : /* StrEquals.proto */
2360 : #if PY_MAJOR_VERSION >= 3
2361 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2362 : #else
2363 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2364 : #endif
2365 :
2366 : /* PyObjectFormatSimple.proto */
2367 : #if CYTHON_COMPILING_IN_PYPY
2368 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2369 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2370 : PyObject_Format(s, f))
2371 : #elif PY_MAJOR_VERSION < 3
2372 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2373 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2374 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2375 : PyObject_Format(s, f))
2376 : #elif CYTHON_USE_TYPE_SLOTS
2377 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2378 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2379 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2380 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2381 : PyObject_Format(s, f))
2382 : #else
2383 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2384 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2385 : PyObject_Format(s, f))
2386 : #endif
2387 :
2388 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2389 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2390 : /* GetAttr.proto */
2391 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2392 :
2393 : /* GetItemInt.proto */
2394 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2395 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2396 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2397 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2398 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2399 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2400 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2401 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2402 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2403 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2404 : int wraparound, int boundscheck);
2405 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2406 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2407 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2408 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2409 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2410 : int wraparound, int boundscheck);
2411 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2412 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2413 : int is_list, int wraparound, int boundscheck);
2414 :
2415 : /* PyObjectCallOneArg.proto */
2416 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2417 :
2418 : /* ObjectGetItem.proto */
2419 : #if CYTHON_USE_TYPE_SLOTS
2420 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2421 : #else
2422 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2423 : #endif
2424 :
2425 : /* KeywordStringCheck.proto */
2426 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2427 :
2428 : /* DivInt[Py_ssize_t].proto */
2429 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2430 :
2431 : /* UnaryNegOverflows.proto */
2432 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2433 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2434 :
2435 : /* GetAttr3.proto */
2436 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2437 :
2438 : /* PyDictVersioning.proto */
2439 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2440 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2441 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2442 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2443 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2444 : (cache_var) = (value);
2445 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2446 : static PY_UINT64_T __pyx_dict_version = 0;\
2447 : static PyObject *__pyx_dict_cached_value = NULL;\
2448 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2449 : (VAR) = __pyx_dict_cached_value;\
2450 : } else {\
2451 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2452 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2453 : }\
2454 : }
2455 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2456 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2457 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2458 : #else
2459 : #define __PYX_GET_DICT_VERSION(dict) (0)
2460 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2461 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2462 : #endif
2463 :
2464 : /* GetModuleGlobalName.proto */
2465 : #if CYTHON_USE_DICT_VERSIONS
2466 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2467 : static PY_UINT64_T __pyx_dict_version = 0;\
2468 : static PyObject *__pyx_dict_cached_value = NULL;\
2469 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2470 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2471 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2472 : } while(0)
2473 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2474 : PY_UINT64_T __pyx_dict_version;\
2475 : PyObject *__pyx_dict_cached_value;\
2476 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2477 : } while(0)
2478 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2479 : #else
2480 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2481 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2482 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2483 : #endif
2484 :
2485 : /* AssertionsEnabled.proto */
2486 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2487 : #define __Pyx_init_assertions_enabled() (0)
2488 : #define __pyx_assertions_enabled() (1)
2489 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2490 : static int __pyx_assertions_enabled_flag;
2491 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2492 1 : static int __Pyx_init_assertions_enabled(void) {
2493 1 : PyObject *builtins, *debug, *debug_str;
2494 1 : int flag;
2495 1 : builtins = PyEval_GetBuiltins();
2496 1 : if (!builtins) goto bad;
2497 1 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2498 1 : if (!debug_str) goto bad;
2499 1 : debug = PyObject_GetItem(builtins, debug_str);
2500 1 : Py_DECREF(debug_str);
2501 1 : if (!debug) goto bad;
2502 1 : flag = PyObject_IsTrue(debug);
2503 1 : Py_DECREF(debug);
2504 1 : if (flag == -1) goto bad;
2505 1 : __pyx_assertions_enabled_flag = flag;
2506 1 : return 0;
2507 0 : bad:
2508 0 : __pyx_assertions_enabled_flag = 1;
2509 0 : return -1;
2510 : }
2511 : #else
2512 : #define __Pyx_init_assertions_enabled() (0)
2513 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2514 : #endif
2515 :
2516 : /* RaiseTooManyValuesToUnpack.proto */
2517 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2518 :
2519 : /* RaiseNeedMoreValuesToUnpack.proto */
2520 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2521 :
2522 : /* RaiseNoneIterError.proto */
2523 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2524 :
2525 : /* ExtTypeTest.proto */
2526 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2527 :
2528 : /* GetTopmostException.proto */
2529 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2530 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2531 : #endif
2532 :
2533 : /* SaveResetException.proto */
2534 : #if CYTHON_FAST_THREAD_STATE
2535 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2536 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2537 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2538 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2539 : #else
2540 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2541 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2542 : #endif
2543 :
2544 : /* GetException.proto */
2545 : #if CYTHON_FAST_THREAD_STATE
2546 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2547 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2548 : #else
2549 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2550 : #endif
2551 :
2552 : /* SwapException.proto */
2553 : #if CYTHON_FAST_THREAD_STATE
2554 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2555 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2556 : #else
2557 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2558 : #endif
2559 :
2560 : /* Import.proto */
2561 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2562 :
2563 : /* ImportDottedModule.proto */
2564 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2565 : #if PY_MAJOR_VERSION >= 3
2566 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2567 : #endif
2568 :
2569 : /* FastTypeChecks.proto */
2570 : #if CYTHON_COMPILING_IN_CPYTHON
2571 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2572 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2573 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2574 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2575 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2576 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2577 : #else
2578 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2579 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2580 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2581 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2582 : #endif
2583 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2584 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2585 :
2586 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2587 : /* ListCompAppend.proto */
2588 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2589 263543 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2590 263543 : PyListObject* L = (PyListObject*) list;
2591 263543 : Py_ssize_t len = Py_SIZE(list);
2592 263543 : if (likely(L->allocated > len)) {
2593 244928 : Py_INCREF(x);
2594 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2595 : L->ob_item[len] = x;
2596 : #else
2597 244928 : PyList_SET_ITEM(list, len, x);
2598 : #endif
2599 244928 : __Pyx_SET_SIZE(list, len + 1);
2600 244928 : return 0;
2601 : }
2602 18615 : return PyList_Append(list, x);
2603 : }
2604 : #else
2605 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2606 : #endif
2607 :
2608 : /* PySequenceMultiply.proto */
2609 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2610 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2611 :
2612 : /* SetItemInt.proto */
2613 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2614 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2615 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2616 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2617 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2618 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2619 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2620 : int is_list, int wraparound, int boundscheck);
2621 :
2622 : /* RaiseUnboundLocalError.proto */
2623 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2624 :
2625 : /* DivInt[long].proto */
2626 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2627 :
2628 : /* PySequenceContains.proto */
2629 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2630 0 : int result = PySequence_Contains(seq, item);
2631 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2632 : }
2633 :
2634 : /* ImportFrom.proto */
2635 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2636 :
2637 : /* HasAttr.proto */
2638 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2639 :
2640 : /* IncludeCppStringH.proto */
2641 : #include <string>
2642 :
2643 : /* decode_c_string_utf16.proto */
2644 : static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2645 : int byteorder = 0;
2646 : return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2647 : }
2648 : static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2649 : int byteorder = -1;
2650 : return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2651 : }
2652 : static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2653 : int byteorder = 1;
2654 : return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2655 : }
2656 :
2657 : /* decode_c_bytes.proto */
2658 : static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
2659 : const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
2660 : const char* encoding, const char* errors,
2661 : PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2662 :
2663 : /* decode_cpp_string.proto */
2664 1075 : static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
2665 : std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
2666 : const char* encoding, const char* errors,
2667 : PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
2668 1075 : return __Pyx_decode_c_bytes(
2669 1075 : cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
2670 : }
2671 :
2672 : /* PyObject_Unicode.proto */
2673 : #if PY_MAJOR_VERSION >= 3
2674 : #define __Pyx_PyObject_Unicode(obj)\
2675 : (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2676 : #else
2677 : #define __Pyx_PyObject_Unicode(obj)\
2678 : (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2679 : #endif
2680 :
2681 : /* PyObjectFormatAndDecref.proto */
2682 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
2683 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
2684 :
2685 : /* PyIntBinop.proto */
2686 : #if !CYTHON_COMPILING_IN_PYPY
2687 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2688 : #else
2689 : #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2690 : (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2691 : #endif
2692 :
2693 : /* IterFinish.proto */
2694 : static CYTHON_INLINE int __Pyx_IterFinish(void);
2695 :
2696 : /* set_iter.proto */
2697 : static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
2698 : Py_ssize_t* p_orig_length, int* p_source_is_set);
2699 : static CYTHON_INLINE int __Pyx_set_iter_next(
2700 : PyObject* iter_obj, Py_ssize_t orig_length,
2701 : Py_ssize_t* ppos, PyObject **value,
2702 : int source_is_set);
2703 :
2704 : /* dict_getitem_default.proto */
2705 : static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
2706 :
2707 : /* UnpackUnboundCMethod.proto */
2708 : typedef struct {
2709 : PyObject *type;
2710 : PyObject **method_name;
2711 : PyCFunction func;
2712 : PyObject *method;
2713 : int flag;
2714 : } __Pyx_CachedCFunction;
2715 :
2716 : /* CallUnboundCMethod1.proto */
2717 : static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2718 : #if CYTHON_COMPILING_IN_CPYTHON
2719 : static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2720 : #else
2721 : #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
2722 : #endif
2723 :
2724 : /* CallUnboundCMethod2.proto */
2725 : static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2726 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
2727 : static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2728 : #else
2729 : #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2730 : #endif
2731 :
2732 : /* MoveIfSupported.proto */
2733 : #if CYTHON_USE_CPP_STD_MOVE
2734 : #include <utility>
2735 : #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
2736 : #else
2737 : #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
2738 : #endif
2739 :
2740 : /* BufferIndexError.proto */
2741 : static void __Pyx_RaiseBufferIndexError(int axis);
2742 :
2743 : /* PyObject_GenericGetAttrNoDict.proto */
2744 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2745 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2746 : #else
2747 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2748 : #endif
2749 :
2750 : /* PyObject_GenericGetAttr.proto */
2751 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2752 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2753 : #else
2754 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2755 : #endif
2756 :
2757 : /* IncludeStructmemberH.proto */
2758 : #include <structmember.h>
2759 :
2760 : /* FixUpExtensionType.proto */
2761 : #if CYTHON_USE_TYPE_SPECS
2762 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2763 : #endif
2764 :
2765 : /* PyObjectCallNoArg.proto */
2766 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2767 :
2768 : /* PyObjectGetMethod.proto */
2769 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2770 :
2771 : /* PyObjectCallMethod0.proto */
2772 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2773 :
2774 : /* ValidateBasesTuple.proto */
2775 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2776 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2777 : #endif
2778 :
2779 : /* PyType_Ready.proto */
2780 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2781 :
2782 : /* SetVTable.proto */
2783 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2784 :
2785 : /* GetVTable.proto */
2786 : static void* __Pyx_GetVtable(PyTypeObject *type);
2787 :
2788 : /* MergeVTables.proto */
2789 : #if !CYTHON_COMPILING_IN_LIMITED_API
2790 : static int __Pyx_MergeVtables(PyTypeObject *type);
2791 : #endif
2792 :
2793 : /* SetupReduce.proto */
2794 : #if !CYTHON_COMPILING_IN_LIMITED_API
2795 : static int __Pyx_setup_reduce(PyObject* type_obj);
2796 : #endif
2797 :
2798 : /* TypeImport.proto */
2799 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2800 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2801 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2802 : #include <stdalign.h>
2803 : #endif
2804 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2805 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2806 : #else
2807 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2808 : #endif
2809 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2810 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2811 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2812 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2813 : };
2814 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2815 : #endif
2816 :
2817 : /* FetchSharedCythonModule.proto */
2818 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2819 :
2820 : /* FetchCommonType.proto */
2821 : #if !CYTHON_USE_TYPE_SPECS
2822 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2823 : #else
2824 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2825 : #endif
2826 :
2827 : /* PyMethodNew.proto */
2828 : #if CYTHON_COMPILING_IN_LIMITED_API
2829 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2830 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2831 : CYTHON_UNUSED_VAR(typ);
2832 : if (!self)
2833 : return __Pyx_NewRef(func);
2834 : typesModule = PyImport_ImportModule("types");
2835 : if (!typesModule) return NULL;
2836 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2837 : Py_DECREF(typesModule);
2838 : if (!methodType) return NULL;
2839 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2840 : Py_DECREF(methodType);
2841 : return result;
2842 : }
2843 : #elif PY_MAJOR_VERSION >= 3
2844 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2845 0 : CYTHON_UNUSED_VAR(typ);
2846 0 : if (!self)
2847 0 : return __Pyx_NewRef(func);
2848 0 : return PyMethod_New(func, self);
2849 : }
2850 : #else
2851 : #define __Pyx_PyMethod_New PyMethod_New
2852 : #endif
2853 :
2854 : /* PyVectorcallFastCallDict.proto */
2855 : #if CYTHON_METH_FASTCALL
2856 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2857 : #endif
2858 :
2859 : /* CythonFunctionShared.proto */
2860 : #define __Pyx_CyFunction_USED
2861 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2862 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2863 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2864 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2865 : #define __Pyx_CyFunction_GetClosure(f)\
2866 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2867 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2868 : #define __Pyx_CyFunction_GetClassObj(f)\
2869 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2870 : #else
2871 : #define __Pyx_CyFunction_GetClassObj(f)\
2872 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2873 : #endif
2874 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2875 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2876 : #define __Pyx_CyFunction_Defaults(type, f)\
2877 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2878 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2879 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2880 : typedef struct {
2881 : #if CYTHON_COMPILING_IN_LIMITED_API
2882 : PyObject_HEAD
2883 : PyObject *func;
2884 : #elif PY_VERSION_HEX < 0x030900B1
2885 : PyCFunctionObject func;
2886 : #else
2887 : PyCMethodObject func;
2888 : #endif
2889 : #if CYTHON_BACKPORT_VECTORCALL
2890 : __pyx_vectorcallfunc func_vectorcall;
2891 : #endif
2892 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2893 : PyObject *func_weakreflist;
2894 : #endif
2895 : PyObject *func_dict;
2896 : PyObject *func_name;
2897 : PyObject *func_qualname;
2898 : PyObject *func_doc;
2899 : PyObject *func_globals;
2900 : PyObject *func_code;
2901 : PyObject *func_closure;
2902 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2903 : PyObject *func_classobj;
2904 : #endif
2905 : void *defaults;
2906 : int defaults_pyobjects;
2907 : size_t defaults_size;
2908 : int flags;
2909 : PyObject *defaults_tuple;
2910 : PyObject *defaults_kwdict;
2911 : PyObject *(*defaults_getter)(PyObject *);
2912 : PyObject *func_annotations;
2913 : PyObject *func_is_coroutine;
2914 : } __pyx_CyFunctionObject;
2915 : #undef __Pyx_CyOrPyCFunction_Check
2916 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2917 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2918 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2919 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2920 : #undef __Pyx_IsSameCFunction
2921 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2922 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2923 : int flags, PyObject* qualname,
2924 : PyObject *closure,
2925 : PyObject *module, PyObject *globals,
2926 : PyObject* code);
2927 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2928 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2929 : size_t size,
2930 : int pyobjects);
2931 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2932 : PyObject *tuple);
2933 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2934 : PyObject *dict);
2935 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2936 : PyObject *dict);
2937 : static int __pyx_CyFunction_init(PyObject *module);
2938 : #if CYTHON_METH_FASTCALL
2939 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2940 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2941 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2942 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2943 : #if CYTHON_BACKPORT_VECTORCALL
2944 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2945 : #else
2946 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2947 : #endif
2948 : #endif
2949 :
2950 : /* CythonFunction.proto */
2951 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2952 : int flags, PyObject* qualname,
2953 : PyObject *closure,
2954 : PyObject *module, PyObject *globals,
2955 : PyObject* code);
2956 :
2957 : /* CLineInTraceback.proto */
2958 : #ifdef CYTHON_CLINE_IN_TRACEBACK
2959 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2960 : #else
2961 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2962 : #endif
2963 :
2964 : /* CodeObjectCache.proto */
2965 : #if !CYTHON_COMPILING_IN_LIMITED_API
2966 : typedef struct {
2967 : PyCodeObject* code_object;
2968 : int code_line;
2969 : } __Pyx_CodeObjectCacheEntry;
2970 : struct __Pyx_CodeObjectCache {
2971 : int count;
2972 : int max_count;
2973 : __Pyx_CodeObjectCacheEntry* entries;
2974 : };
2975 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2976 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2977 : static PyCodeObject *__pyx_find_code_object(int code_line);
2978 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2979 : #endif
2980 :
2981 : /* AddTraceback.proto */
2982 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
2983 : int py_line, const char *filename);
2984 :
2985 : #if PY_MAJOR_VERSION < 3
2986 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2987 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
2988 : #else
2989 : #define __Pyx_GetBuffer PyObject_GetBuffer
2990 : #define __Pyx_ReleaseBuffer PyBuffer_Release
2991 : #endif
2992 :
2993 :
2994 : /* BufferStructDeclare.proto */
2995 : typedef struct {
2996 : Py_ssize_t shape, strides, suboffsets;
2997 : } __Pyx_Buf_DimInfo;
2998 : typedef struct {
2999 : size_t refcount;
3000 : Py_buffer pybuffer;
3001 : } __Pyx_Buffer;
3002 : typedef struct {
3003 : __Pyx_Buffer *rcbuffer;
3004 : char *data;
3005 : __Pyx_Buf_DimInfo diminfo[8];
3006 : } __Pyx_LocalBuf_ND;
3007 :
3008 : /* MemviewSliceIsContig.proto */
3009 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3010 :
3011 : /* OverlappingSlices.proto */
3012 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3013 : __Pyx_memviewslice *slice2,
3014 : int ndim, size_t itemsize);
3015 :
3016 : /* IsLittleEndian.proto */
3017 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
3018 :
3019 : /* BufferFormatCheck.proto */
3020 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
3021 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3022 : __Pyx_BufFmt_StackElem* stack,
3023 : __Pyx_TypeInfo* type);
3024 :
3025 : /* TypeInfoCompare.proto */
3026 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3027 :
3028 : /* MemviewSliceValidateAndInit.proto */
3029 : static int __Pyx_ValidateAndInit_memviewslice(
3030 : int *axes_specs,
3031 : int c_or_f_flag,
3032 : int buf_flags,
3033 : int ndim,
3034 : __Pyx_TypeInfo *dtype,
3035 : __Pyx_BufFmt_StackElem stack[],
3036 : __Pyx_memviewslice *memviewslice,
3037 : PyObject *original_obj);
3038 :
3039 : /* ObjectToMemviewSlice.proto */
3040 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag);
3041 :
3042 : /* ObjectToMemviewSlice.proto */
3043 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *, int writable_flag);
3044 :
3045 : /* ObjectToMemviewSlice.proto */
3046 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *, int writable_flag);
3047 :
3048 : /* MemviewDtypeToObject.proto */
3049 : static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
3050 : static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
3051 :
3052 : /* MemviewDtypeToObject.proto */
3053 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp);
3054 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj);
3055 :
3056 : /* CppExceptionConversion.proto */
3057 : #ifndef __Pyx_CppExn2PyErr
3058 : #include <new>
3059 : #include <typeinfo>
3060 : #include <stdexcept>
3061 : #include <ios>
3062 0 : static void __Pyx_CppExn2PyErr() {
3063 0 : try {
3064 0 : if (PyErr_Occurred())
3065 : ; // let the latest Python exn pass through and ignore the current one
3066 : else
3067 0 : throw;
3068 0 : } catch (const std::bad_alloc& exn) {
3069 0 : PyErr_SetString(PyExc_MemoryError, exn.what());
3070 0 : } catch (const std::bad_cast& exn) {
3071 0 : PyErr_SetString(PyExc_TypeError, exn.what());
3072 0 : } catch (const std::bad_typeid& exn) {
3073 0 : PyErr_SetString(PyExc_TypeError, exn.what());
3074 0 : } catch (const std::domain_error& exn) {
3075 0 : PyErr_SetString(PyExc_ValueError, exn.what());
3076 0 : } catch (const std::invalid_argument& exn) {
3077 0 : PyErr_SetString(PyExc_ValueError, exn.what());
3078 0 : } catch (const std::ios_base::failure& exn) {
3079 0 : PyErr_SetString(PyExc_IOError, exn.what());
3080 0 : } catch (const std::out_of_range& exn) {
3081 0 : PyErr_SetString(PyExc_IndexError, exn.what());
3082 0 : } catch (const std::overflow_error& exn) {
3083 0 : PyErr_SetString(PyExc_OverflowError, exn.what());
3084 0 : } catch (const std::range_error& exn) {
3085 0 : PyErr_SetString(PyExc_ArithmeticError, exn.what());
3086 0 : } catch (const std::underflow_error& exn) {
3087 0 : PyErr_SetString(PyExc_ArithmeticError, exn.what());
3088 0 : } catch (const std::exception& exn) {
3089 0 : PyErr_SetString(PyExc_RuntimeError, exn.what());
3090 0 : }
3091 0 : catch (...)
3092 : {
3093 0 : PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
3094 0 : }
3095 0 : }
3096 : #endif
3097 :
3098 : /* ObjectToMemviewSlice.proto */
3099 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
3100 :
3101 : /* RealImag.proto */
3102 : #if CYTHON_CCOMPLEX
3103 : #ifdef __cplusplus
3104 : #define __Pyx_CREAL(z) ((z).real())
3105 : #define __Pyx_CIMAG(z) ((z).imag())
3106 : #else
3107 : #define __Pyx_CREAL(z) (__real__(z))
3108 : #define __Pyx_CIMAG(z) (__imag__(z))
3109 : #endif
3110 : #else
3111 : #define __Pyx_CREAL(z) ((z).real)
3112 : #define __Pyx_CIMAG(z) ((z).imag)
3113 : #endif
3114 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3115 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3116 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3117 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3118 : #else
3119 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3120 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3121 : #endif
3122 :
3123 : /* Arithmetic.proto */
3124 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3125 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
3126 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
3127 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
3128 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
3129 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
3130 : #define __Pyx_c_neg_float(a) (-(a))
3131 : #ifdef __cplusplus
3132 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3133 : #define __Pyx_c_conj_float(z) (::std::conj(z))
3134 : #if 1
3135 : #define __Pyx_c_abs_float(z) (::std::abs(z))
3136 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3137 : #endif
3138 : #else
3139 : #define __Pyx_c_is_zero_float(z) ((z)==0)
3140 : #define __Pyx_c_conj_float(z) (conjf(z))
3141 : #if 1
3142 : #define __Pyx_c_abs_float(z) (cabsf(z))
3143 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3144 : #endif
3145 : #endif
3146 : #else
3147 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3148 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3149 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3150 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3151 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3152 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3153 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3154 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3155 : #if 1
3156 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3157 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3158 : #endif
3159 : #endif
3160 :
3161 : /* Arithmetic.proto */
3162 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3163 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
3164 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
3165 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
3166 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
3167 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
3168 : #define __Pyx_c_neg_double(a) (-(a))
3169 : #ifdef __cplusplus
3170 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3171 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3172 : #if 1
3173 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3174 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3175 : #endif
3176 : #else
3177 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3178 : #define __Pyx_c_conj_double(z) (conj(z))
3179 : #if 1
3180 : #define __Pyx_c_abs_double(z) (cabs(z))
3181 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3182 : #endif
3183 : #endif
3184 : #else
3185 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3186 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3187 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3188 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3189 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3190 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3191 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3192 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3193 : #if 1
3194 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3195 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3196 : #endif
3197 : #endif
3198 :
3199 : /* Arithmetic.proto */
3200 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3201 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3202 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3203 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3204 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3205 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3206 : #define __Pyx_c_neg_long__double(a) (-(a))
3207 : #ifdef __cplusplus
3208 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3209 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3210 : #if 1
3211 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3212 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3213 : #endif
3214 : #else
3215 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3216 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3217 : #if 1
3218 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3219 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3220 : #endif
3221 : #endif
3222 : #else
3223 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3224 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3225 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3226 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3227 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3228 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3229 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3230 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3231 : #if 1
3232 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3233 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3234 : #endif
3235 : #endif
3236 :
3237 : /* MemviewSliceCopyTemplate.proto */
3238 : static __Pyx_memviewslice
3239 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3240 : const char *mode, int ndim,
3241 : size_t sizeof_dtype, int contig_flag,
3242 : int dtype_is_object);
3243 :
3244 : /* MemviewSliceInit.proto */
3245 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3246 : #define __Pyx_MEMVIEW_DIRECT 1
3247 : #define __Pyx_MEMVIEW_PTR 2
3248 : #define __Pyx_MEMVIEW_FULL 4
3249 : #define __Pyx_MEMVIEW_CONTIG 8
3250 : #define __Pyx_MEMVIEW_STRIDED 16
3251 : #define __Pyx_MEMVIEW_FOLLOW 32
3252 : #define __Pyx_IS_C_CONTIG 1
3253 : #define __Pyx_IS_F_CONTIG 2
3254 : static int __Pyx_init_memviewslice(
3255 : struct __pyx_memoryview_obj *memview,
3256 : int ndim,
3257 : __Pyx_memviewslice *memviewslice,
3258 : int memview_is_new_reference);
3259 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3260 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3261 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3262 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3263 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3264 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3265 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3266 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3267 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3268 :
3269 : /* CIntToPy.proto */
3270 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3271 :
3272 : /* CIntFromPy.proto */
3273 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3274 :
3275 : /* CIntToPy.proto */
3276 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value);
3277 :
3278 : /* CIntFromPy.proto */
3279 : static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *);
3280 :
3281 : /* None.proto */
3282 : #include <new>
3283 :
3284 : /* CIntFromPy.proto */
3285 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3286 :
3287 : /* CIntToPy.proto */
3288 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3289 :
3290 : /* CIntFromPy.proto */
3291 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3292 :
3293 : /* FormatTypeName.proto */
3294 : #if CYTHON_COMPILING_IN_LIMITED_API
3295 : typedef PyObject *__Pyx_TypeName;
3296 : #define __Pyx_FMT_TYPENAME "%U"
3297 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3298 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3299 : #else
3300 : typedef const char *__Pyx_TypeName;
3301 : #define __Pyx_FMT_TYPENAME "%.200s"
3302 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3303 : #define __Pyx_DECREF_TypeName(obj)
3304 : #endif
3305 :
3306 : /* CheckBinaryVersion.proto */
3307 : static unsigned long __Pyx_get_runtime_version(void);
3308 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3309 :
3310 : /* InitStrings.proto */
3311 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3312 :
3313 : /* #### Code section: module_declarations ### */
3314 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3315 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3316 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3317 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3318 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3319 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3320 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3321 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3322 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3323 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3324 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3325 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3326 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3327 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3328 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3329 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3330 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3331 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3332 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3333 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3334 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3335 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3336 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3337 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3338 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3339 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3340 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3341 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3342 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3343 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3344 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3345 :
3346 : /* Module declarations from "libc.string" */
3347 :
3348 : /* Module declarations from "libc.stdio" */
3349 :
3350 : /* Module declarations from "__builtin__" */
3351 :
3352 : /* Module declarations from "cpython.type" */
3353 :
3354 : /* Module declarations from "cpython" */
3355 :
3356 : /* Module declarations from "cpython.object" */
3357 :
3358 : /* Module declarations from "cpython.ref" */
3359 :
3360 : /* Module declarations from "numpy" */
3361 :
3362 : /* Module declarations from "numpy" */
3363 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3364 :
3365 : /* Module declarations from "libcpp.string" */
3366 :
3367 : /* Module declarations from "libcpp.utility" */
3368 :
3369 : /* Module declarations from "libcpp.map" */
3370 :
3371 : /* Module declarations from "libcpp.cast" */
3372 :
3373 : /* Module declarations from "libcpp" */
3374 :
3375 : /* Module declarations from "scipy.optimize._highs.cython.src.HConst" */
3376 :
3377 : /* Module declarations from "scipy.optimize._highs.cython.src.HighsStatus" */
3378 :
3379 : /* Module declarations from "libcpp.vector" */
3380 :
3381 : /* Module declarations from "scipy.optimize._highs.cython.src.HighsOptions" */
3382 :
3383 : /* Module declarations from "scipy.optimize._highs.cython.src.HighsInfo" */
3384 :
3385 : /* Module declarations from "scipy.optimize._highs.cython.src.HighsSparseMatrix" */
3386 :
3387 : /* Module declarations from "scipy.optimize._highs.cython.src.HighsLp" */
3388 :
3389 : /* Module declarations from "scipy.optimize._highs.cython.src.Highs" */
3390 :
3391 : /* Module declarations from "scipy.optimize._highs.cython.src.HighsModelUtils" */
3392 :
3393 : /* Module declarations from "scipy.optimize._highs.cython.src._highs_wrapper" */
3394 : static HighsOptions __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__ref_opts;
3395 : static std::map<std::string,OptionRecord *> __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__ref_opt_lookup;
3396 : static OptionRecord *__pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__r;
3397 : static PyObject *__pyx_collections_abc_Sequence = 0;
3398 : static PyObject *generic = 0;
3399 : static PyObject *strided = 0;
3400 : static PyObject *indirect = 0;
3401 : static PyObject *contiguous = 0;
3402 : static PyObject *indirect_contiguous = 0;
3403 : static int __pyx_memoryview_thread_locks_used;
3404 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3405 : static PyObject *__pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(std::string, PyObject *, struct __pyx_opt_args_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning *__pyx_optional_args); /*proto*/
3406 : static void __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_apply_options(PyObject *, Highs &); /*proto*/
3407 : static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
3408 : static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
3409 : static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
3410 : static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
3411 : static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
3412 : static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
3413 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3414 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3415 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3416 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3417 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3418 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3419 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3420 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3421 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3422 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3423 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3424 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3425 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3426 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3427 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3428 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3429 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3430 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3431 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3432 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3433 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3434 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3435 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3436 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3437 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3438 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3439 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3440 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3441 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3442 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3443 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3444 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3445 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3446 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3447 : /* #### Code section: typeinfo ### */
3448 : static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
3449 : static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
3450 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
3451 : /* #### Code section: before_global_var ### */
3452 : #define __Pyx_MODULE_NAME "scipy.optimize._highs.cython.src._highs_wrapper"
3453 : extern int __pyx_module_is_main_scipy__optimize___highs__cython__src___highs_wrapper;
3454 : int __pyx_module_is_main_scipy__optimize___highs__cython__src___highs_wrapper = 0;
3455 :
3456 : /* Implementation of "scipy.optimize._highs.cython.src._highs_wrapper" */
3457 : /* #### Code section: global_var ### */
3458 : static PyObject *__pyx_builtin_range;
3459 : static PyObject *__pyx_builtin___import__;
3460 : static PyObject *__pyx_builtin_ValueError;
3461 : static PyObject *__pyx_builtin_MemoryError;
3462 : static PyObject *__pyx_builtin_enumerate;
3463 : static PyObject *__pyx_builtin_TypeError;
3464 : static PyObject *__pyx_builtin_AssertionError;
3465 : static PyObject *__pyx_builtin_Ellipsis;
3466 : static PyObject *__pyx_builtin_id;
3467 : static PyObject *__pyx_builtin_IndexError;
3468 : static PyObject *__pyx_builtin_ImportError;
3469 : /* #### Code section: string_decls ### */
3470 : static const char __pyx_k_[] = ": ";
3471 : static const char __pyx_k_O[] = "O";
3472 : static const char __pyx_k_c[] = "c";
3473 : static const char __pyx_k_d[] = "d";
3474 : static const char __pyx_k_x[] = "x";
3475 : static const char __pyx_k__2[] = ".";
3476 : static const char __pyx_k__3[] = "*";
3477 : static const char __pyx_k__6[] = "'";
3478 : static const char __pyx_k__7[] = ")";
3479 : static const char __pyx_k_gc[] = "gc";
3480 : static const char __pyx_k_id[] = "id";
3481 : static const char __pyx_k_ii[] = "ii";
3482 : static const char __pyx_k_is[] = "\" is \"";
3483 : static const char __pyx_k_lb[] = "lb";
3484 : static const char __pyx_k_lp[] = "lp";
3485 : static const char __pyx_k_np[] = "np";
3486 : static const char __pyx_k_on[] = "on";
3487 : static const char __pyx_k_ub[] = "ub";
3488 : static const char __pyx_k__11[] = "[";
3489 : static const char __pyx_k__12[] = ", ";
3490 : static const char __pyx_k__13[] = "]";
3491 : static const char __pyx_k__14[] = "\", ";
3492 : static const char __pyx_k__28[] = "?";
3493 : static const char __pyx_k_abc[] = "abc";
3494 : static const char __pyx_k_and[] = " and ";
3495 : static const char __pyx_k_fun[] = "fun";
3496 : static const char __pyx_k_get[] = "get";
3497 : static const char __pyx_k_got[] = " (got ";
3498 : static const char __pyx_k_lhs[] = "lhs";
3499 : static const char __pyx_k_new[] = "__new__";
3500 : static const char __pyx_k_obj[] = "obj";
3501 : static const char __pyx_k_off[] = "off";
3502 : static const char __pyx_k_res[] = "res";
3503 : static const char __pyx_k_rhs[] = "rhs";
3504 : static const char __pyx_k_sys[] = "sys";
3505 : static const char __pyx_k_base[] = "base";
3506 : static const char __pyx_k_dict[] = "__dict__";
3507 : static const char __pyx_k_info[] = "info";
3508 : static const char __pyx_k_main[] = "__main__";
3509 : static const char __pyx_k_mode[] = "mode";
3510 : static const char __pyx_k_name[] = "name";
3511 : static const char __pyx_k_ndim[] = "ndim";
3512 : static const char __pyx_k_pack[] = "pack";
3513 : static const char __pyx_k_size[] = "size";
3514 : static const char __pyx_k_spec[] = "__spec__";
3515 : static const char __pyx_k_step[] = "step";
3516 : static const char __pyx_k_stop[] = "stop";
3517 : static const char __pyx_k_test[] = "__test__";
3518 : static const char __pyx_k_warn[] = "warn";
3519 : static const char __pyx_k_ASCII[] = "ASCII";
3520 : static const char __pyx_k_basis[] = "basis";
3521 : static const char __pyx_k_class[] = "__class__";
3522 : static const char __pyx_k_count[] = "count";
3523 : static const char __pyx_k_error[] = "error";
3524 : static const char __pyx_k_flags[] = "flags";
3525 : static const char __pyx_k_highs[] = "highs";
3526 : static const char __pyx_k_index[] = "index";
3527 : static const char __pyx_k_numnz[] = "numnz";
3528 : static const char __pyx_k_numpy[] = "numpy";
3529 : static const char __pyx_k_range[] = "range";
3530 : static const char __pyx_k_shape[] = "shape";
3531 : static const char __pyx_k_slack[] = "slack";
3532 : static const char __pyx_k_start[] = "start";
3533 : static const char __pyx_k_zeros[] = "zeros";
3534 : static const char __pyx_k_Number[] = "Number";
3535 : static const char __pyx_k_Option[] = "Option \"";
3536 : static const char __pyx_k_aindex[] = "aindex";
3537 : static const char __pyx_k_astart[] = "astart";
3538 : static const char __pyx_k_avalue[] = "avalue";
3539 : static const char __pyx_k_enable[] = "enable";
3540 : static const char __pyx_k_encode[] = "encode";
3541 : static const char __pyx_k_format[] = "format";
3542 : static const char __pyx_k_import[] = "__import__";
3543 : static const char __pyx_k_lambda[] = "lambda";
3544 : static const char __pyx_k_name_2[] = "__name__";
3545 : static const char __pyx_k_numcol[] = "numcol";
3546 : static const char __pyx_k_numrow[] = "numrow";
3547 : static const char __pyx_k_pickle[] = "pickle";
3548 : static const char __pyx_k_reduce[] = "__reduce__";
3549 : static const char __pyx_k_solver[] = "solver";
3550 : static const char __pyx_k_status[] = "status";
3551 : static const char __pyx_k_struct[] = "struct";
3552 : static const char __pyx_k_unpack[] = "unpack";
3553 : static const char __pyx_k_update[] = "update";
3554 : static const char __pyx_k_disable[] = "disable";
3555 : static const char __pyx_k_fortran[] = "fortran";
3556 : static const char __pyx_k_ipm_nit[] = "ipm_nit";
3557 : static const char __pyx_k_memview[] = "memview";
3558 : static const char __pyx_k_message[] = "message";
3559 : static const char __pyx_k_mip_gap[] = "mip_gap";
3560 : static const char __pyx_k_numbers[] = "numbers";
3561 : static const char __pyx_k_options[] = "options";
3562 : static const char __pyx_k_threads[] = "threads";
3563 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3564 : static const char __pyx_k_Sequence[] = "Sequence";
3565 : static const char __pyx_k_getstate[] = "__getstate__";
3566 : static const char __pyx_k_itemsize[] = "itemsize";
3567 : static const char __pyx_k_parallel[] = "parallel";
3568 : static const char __pyx_k_presolve[] = "presolve";
3569 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3570 : static const char __pyx_k_register[] = "register";
3571 : static const char __pyx_k_setstate[] = "__setstate__";
3572 : static const char __pyx_k_solution[] = "solution";
3573 : static const char __pyx_k_warnings[] = "warnings";
3574 : static const char __pyx_k_TypeError[] = "TypeError";
3575 : static const char __pyx_k_enumerate[] = "enumerate";
3576 : static const char __pyx_k_isenabled[] = "isenabled";
3577 : static const char __pyx_k_marg_bnds[] = "marg_bnds";
3578 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3579 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3580 : static const char __pyx_k_IndexError[] = "IndexError";
3581 : static const char __pyx_k_ValueError[] = "ValueError";
3582 : static const char __pyx_k_aindex_ptr[] = "aindex_ptr";
3583 : static const char __pyx_k_astart_ptr[] = "astart_ptr";
3584 : static const char __pyx_k_avalue_ptr[] = "avalue_ptr";
3585 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3586 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3587 : static const char __pyx_k_run_status[] = "run_status";
3588 : static const char __pyx_k_time_limit[] = "time_limit";
3589 : static const char __pyx_k_ImportError[] = "ImportError";
3590 : static const char __pyx_k_MemoryError[] = "MemoryError";
3591 : static const char __pyx_k_PickleError[] = "PickleError";
3592 : static const char __pyx_k_colcost_ptr[] = "colcost_ptr";
3593 : static const char __pyx_k_collections[] = "collections";
3594 : static const char __pyx_k_init_status[] = "init_status";
3595 : static const char __pyx_k_integrality[] = "integrality";
3596 : static const char __pyx_k_keep_n_rows[] = "keep_n_rows";
3597 : static const char __pyx_k_mip_rel_gap[] = "mip_rel_gap";
3598 : static const char __pyx_k_output_flag[] = "output_flag";
3599 : static const char __pyx_k_run_as_hsol[] = "run_as_hsol";
3600 : static const char __pyx_k_simplex_nit[] = "simplex_nit";
3601 : static const char __pyx_k_collower_ptr[] = "collower_ptr";
3602 : static const char __pyx_k_colupper_ptr[] = "colupper_ptr";
3603 : static const char __pyx_k_initializing[] = "_initializing";
3604 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3605 : static const char __pyx_k_model_status[] = "model_status";
3606 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3607 : static const char __pyx_k_rowlower_ptr[] = "rowlower_ptr";
3608 : static const char __pyx_k_rowupper_ptr[] = "rowupper_ptr";
3609 : static const char __pyx_k_stringsource[] = "<stringsource>";
3610 : static const char __pyx_k_version_info[] = "version_info";
3611 : static const char __pyx_k_Using_default[] = "Using default: ";
3612 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3613 : static const char __pyx_k_crossover_nit[] = "crossover_nit";
3614 : static const char __pyx_k_highs_wrapper[] = "_highs_wrapper";
3615 : static const char __pyx_k_infinite_cost[] = "infinite_cost";
3616 : static const char __pyx_k_mip_max_nodes[] = "mip_max_nodes";
3617 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3618 : static const char __pyx_k_run_crossover[] = "run_crossover";
3619 : static const char __pyx_k_AssertionError[] = "AssertionError";
3620 : static const char __pyx_k_infinite_bound[] = "infinite_bound";
3621 : static const char __pyx_k_log_to_console[] = "log_to_console";
3622 : static const char __pyx_k_mip_dual_bound[] = "mip_dual_bound";
3623 : static const char __pyx_k_mip_node_count[] = "mip_node_count";
3624 : static const char __pyx_k_numintegrality[] = "numintegrality";
3625 : static const char __pyx_k_scipy_optimize[] = "scipy.optimize";
3626 : static const char __pyx_k_OptimizeWarning[] = "OptimizeWarning";
3627 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3628 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3629 : static const char __pyx_k_collections_abc[] = "collections.abc";
3630 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3631 : static const char __pyx_k_integrality_ptr[] = "integrality_ptr";
3632 : static const char __pyx_k_lpFailCondition[] = "lpFailCondition";
3633 : static const char __pyx_k_model_status_is[] = "model_status is ";
3634 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3635 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3636 : static const char __pyx_k_err_model_status[] = "err_model_status";
3637 : static const char __pyx_k_mipFailCondition[] = "mipFailCondition";
3638 : static const char __pyx_k_primal_status_is[] = "; primal_status is ";
3639 : static const char __pyx_k_simplex_strategy[] = "simplex_strategy";
3640 : static const char __pyx_k_highs_debug_level[] = "highs_debug_level";
3641 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3642 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3643 : static const char __pyx_k_but_only_values_in[] = "\", but only values in ";
3644 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3645 : static const char __pyx_k_large_matrix_value[] = "large_matrix_value";
3646 : static const char __pyx_k_small_matrix_value[] = "small_matrix_value";
3647 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3648 : static const char __pyx_k_ipm_iteration_limit[] = "ipm_iteration_limit";
3649 : static const char __pyx_k_mps_parser_type_free[] = "mps_parser_type_free";
3650 : static const char __pyx_k_simplex_update_limit[] = "simplex_update_limit";
3651 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3652 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3653 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3654 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3655 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3656 : static const char __pyx_k_simplex_crash_strategy[] = "simplex_crash_strategy";
3657 : static const char __pyx_k_simplex_price_strategy[] = "simplex_price_strategy";
3658 : static const char __pyx_k_simplex_scale_strategy[] = "simplex_scale_strategy";
3659 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3660 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3661 : static const char __pyx_k_simplex_iteration_limit[] = "simplex_iteration_limit";
3662 : static const char __pyx_k_ipm_optimality_tolerance[] = "ipm_optimality_tolerance";
3663 : static const char __pyx_k_simplex_dualise_strategy[] = "simplex_dualise_strategy";
3664 : static const char __pyx_k_simplex_permute_strategy[] = "simplex_permute_strategy";
3665 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3666 : static const char __pyx_k_are_allowed_Using_default[] = " are allowed. Using default: ";
3667 : static const char __pyx_k_less_infeasible_DSE_check[] = "less_infeasible_DSE_check";
3668 : static const char __pyx_k_start_crossover_tolerance[] = "start_crossover_tolerance";
3669 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3670 : static const char __pyx_k_dual_feasibility_tolerance[] = "dual_feasibility_tolerance";
3671 : static const char __pyx_k_use_original_HFactor_logic[] = "use_original_HFactor_logic";
3672 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3673 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3674 : static const char __pyx_k_primal_feasibility_tolerance[] = "primal_feasibility_tolerance";
3675 : static const char __pyx_k_dual_simplex_cleanup_strategy[] = "dual_simplex_cleanup_strategy";
3676 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3677 : static const char __pyx_k_but_this_is_an_invalid_value_s[] = "but this is an invalid value. %s. ";
3678 : static const char __pyx_k_less_infeasible_DSE_choose_row[] = "less_infeasible_DSE_choose_row";
3679 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3680 : static const char __pyx_k_but_only_True_or_False_is_allow[] = "\", but only True or False is allowed. Using default: ";
3681 : static const char __pyx_k_but_this_is_not_a_valid_value_S[] = "\", but this is not a valid value. See documentation for valid options. Using default.";
3682 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/optimize/_highs/cython/src/_highs_wrapper.pyx";
3683 : static const char __pyx_k_simplex_initial_condition_check[] = "simplex_initial_condition_check";
3684 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3685 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3686 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3687 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3688 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3689 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3690 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3691 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3692 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3693 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3694 : static const char __pyx_k_Option_s_is_s_but_only_values_in[] = "Option \"%s\" is \"%s\", but only values in (%g, %g) are allowed. Using default: %g.";
3695 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3696 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3697 : static const char __pyx_k_allowed_simplex_cost_scale_facto[] = "allowed_simplex_cost_scale_factor";
3698 : static const char __pyx_k_allowed_simplex_matrix_scale_fac[] = "allowed_simplex_matrix_scale_factor";
3699 : static const char __pyx_k_but_only_values_in_s_are_allowed[] = "but only values in %s are allowed. ";
3700 : static const char __pyx_k_dual_objective_value_upper_bound[] = "dual_objective_value_upper_bound";
3701 : static const char __pyx_k_dual_simplex_cost_perturbation_m[] = "dual_simplex_cost_perturbation_multiplier";
3702 : static const char __pyx_k_dual_steepest_edge_weight_log_er[] = "dual_steepest_edge_weight_log_error_threshhold";
3703 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3704 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3705 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3706 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3707 : static const char __pyx_k_scipy_optimize__highs_cython_src[] = "scipy.optimize._highs.cython.src._highs_wrapper";
3708 : static const char __pyx_k_simplex_dual_edge_weight_strateg[] = "simplex_dual_edge_weight_strategy";
3709 : static const char __pyx_k_simplex_initial_condition_tolera[] = "simplex_initial_condition_tolerance";
3710 : static const char __pyx_k_simplex_primal_edge_weight_strat[] = "simplex_primal_edge_weight_strategy";
3711 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3712 : /* #### Code section: decls ### */
3713 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3714 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3715 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3716 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3717 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3718 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3719 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3720 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3721 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3722 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3723 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3724 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3725 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3726 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3727 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3728 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3729 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3730 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3731 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3732 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3733 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3734 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3735 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3736 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3737 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3738 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3739 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3740 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3741 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3742 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3743 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3744 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3745 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3746 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3747 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3748 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3749 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3750 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3751 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3752 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3753 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3754 : static PyObject *__pyx_pf_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__highs_wrapper(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_c, __Pyx_memviewslice __pyx_v_astart, __Pyx_memviewslice __pyx_v_aindex, __Pyx_memviewslice __pyx_v_avalue, __Pyx_memviewslice __pyx_v_lhs, __Pyx_memviewslice __pyx_v_rhs, __Pyx_memviewslice __pyx_v_lb, __Pyx_memviewslice __pyx_v_ub, __Pyx_memviewslice __pyx_v_integrality, PyObject *__pyx_v_options); /* proto */
3755 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3756 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3757 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3758 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3759 : static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
3760 : static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, 0, 0, 0, 0};
3761 : /* #### Code section: late_includes ### */
3762 : /* #### Code section: module_state ### */
3763 : typedef struct {
3764 : PyObject *__pyx_d;
3765 : PyObject *__pyx_b;
3766 : PyObject *__pyx_cython_runtime;
3767 : PyObject *__pyx_empty_tuple;
3768 : PyObject *__pyx_empty_bytes;
3769 : PyObject *__pyx_empty_unicode;
3770 : #ifdef __Pyx_CyFunction_USED
3771 : PyTypeObject *__pyx_CyFunctionType;
3772 : #endif
3773 : #ifdef __Pyx_FusedFunction_USED
3774 : PyTypeObject *__pyx_FusedFunctionType;
3775 : #endif
3776 : #ifdef __Pyx_Generator_USED
3777 : PyTypeObject *__pyx_GeneratorType;
3778 : #endif
3779 : #ifdef __Pyx_IterableCoroutine_USED
3780 : PyTypeObject *__pyx_IterableCoroutineType;
3781 : #endif
3782 : #ifdef __Pyx_Coroutine_USED
3783 : PyTypeObject *__pyx_CoroutineAwaitType;
3784 : #endif
3785 : #ifdef __Pyx_Coroutine_USED
3786 : PyTypeObject *__pyx_CoroutineType;
3787 : #endif
3788 : #if CYTHON_USE_MODULE_STATE
3789 : #endif
3790 : #if CYTHON_USE_MODULE_STATE
3791 : #endif
3792 : #if CYTHON_USE_MODULE_STATE
3793 : #endif
3794 : #if CYTHON_USE_MODULE_STATE
3795 : #endif
3796 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3797 : #if CYTHON_USE_MODULE_STATE
3798 : #endif
3799 : #if CYTHON_USE_MODULE_STATE
3800 : #endif
3801 : #if CYTHON_USE_MODULE_STATE
3802 : #endif
3803 : #if CYTHON_USE_MODULE_STATE
3804 : #endif
3805 : #if CYTHON_USE_MODULE_STATE
3806 : #endif
3807 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3808 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3809 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3810 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3811 : PyTypeObject *__pyx_ptype_5numpy_generic;
3812 : PyTypeObject *__pyx_ptype_5numpy_number;
3813 : PyTypeObject *__pyx_ptype_5numpy_integer;
3814 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3815 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3816 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3817 : PyTypeObject *__pyx_ptype_5numpy_floating;
3818 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3819 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3820 : PyTypeObject *__pyx_ptype_5numpy_character;
3821 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3822 : #if CYTHON_USE_MODULE_STATE
3823 : #endif
3824 : #if CYTHON_USE_MODULE_STATE
3825 : #endif
3826 : #if CYTHON_USE_MODULE_STATE
3827 : #endif
3828 : #if CYTHON_USE_MODULE_STATE
3829 : #endif
3830 : #if CYTHON_USE_MODULE_STATE
3831 : #endif
3832 : #if CYTHON_USE_MODULE_STATE
3833 : #endif
3834 : #if CYTHON_USE_MODULE_STATE
3835 : #endif
3836 : #if CYTHON_USE_MODULE_STATE
3837 : #endif
3838 : #if CYTHON_USE_MODULE_STATE
3839 : #endif
3840 : #if CYTHON_USE_MODULE_STATE
3841 : #endif
3842 : #if CYTHON_USE_MODULE_STATE
3843 : #endif
3844 : #if CYTHON_USE_MODULE_STATE
3845 : #endif
3846 : #if CYTHON_USE_MODULE_STATE
3847 : #endif
3848 : #if CYTHON_USE_MODULE_STATE
3849 : #endif
3850 : #if CYTHON_USE_MODULE_STATE
3851 : PyObject *__pyx_type___pyx_array;
3852 : PyObject *__pyx_type___pyx_MemviewEnum;
3853 : PyObject *__pyx_type___pyx_memoryview;
3854 : PyObject *__pyx_type___pyx_memoryviewslice;
3855 : #endif
3856 : PyTypeObject *__pyx_array_type;
3857 : PyTypeObject *__pyx_MemviewEnum_type;
3858 : PyTypeObject *__pyx_memoryview_type;
3859 : PyTypeObject *__pyx_memoryviewslice_type;
3860 : PyObject *__pyx_kp_u_;
3861 : PyObject *__pyx_n_s_ASCII;
3862 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
3863 : PyObject *__pyx_n_s_AssertionError;
3864 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3865 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3866 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3867 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3868 : PyObject *__pyx_kp_u_Cannot_index_with_type;
3869 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
3870 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
3871 : PyObject *__pyx_n_s_Ellipsis;
3872 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3873 : PyObject *__pyx_n_s_ImportError;
3874 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3875 : PyObject *__pyx_n_s_IndexError;
3876 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
3877 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3878 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
3879 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
3880 : PyObject *__pyx_n_s_MemoryError;
3881 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3882 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
3883 : PyObject *__pyx_n_s_Number;
3884 : PyObject *__pyx_n_b_O;
3885 : PyObject *__pyx_n_s_OptimizeWarning;
3886 : PyObject *__pyx_kp_u_Option;
3887 : PyObject *__pyx_kp_u_Option_s_is_s_but_only_values_in;
3888 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
3889 : PyObject *__pyx_n_s_PickleError;
3890 : PyObject *__pyx_n_s_Sequence;
3891 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
3892 : PyObject *__pyx_n_s_TypeError;
3893 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3894 : PyObject *__pyx_kp_u_Using_default;
3895 : PyObject *__pyx_n_s_ValueError;
3896 : PyObject *__pyx_n_s_View_MemoryView;
3897 : PyObject *__pyx_kp_u__11;
3898 : PyObject *__pyx_kp_u__12;
3899 : PyObject *__pyx_kp_u__13;
3900 : PyObject *__pyx_kp_u__14;
3901 : PyObject *__pyx_kp_u__2;
3902 : PyObject *__pyx_n_s__28;
3903 : PyObject *__pyx_n_s__3;
3904 : PyObject *__pyx_kp_u__6;
3905 : PyObject *__pyx_kp_u__7;
3906 : PyObject *__pyx_n_s_abc;
3907 : PyObject *__pyx_n_s_aindex;
3908 : PyObject *__pyx_n_s_aindex_ptr;
3909 : PyObject *__pyx_n_s_allocate_buffer;
3910 : PyObject *__pyx_n_u_allowed_simplex_cost_scale_facto;
3911 : PyObject *__pyx_n_u_allowed_simplex_matrix_scale_fac;
3912 : PyObject *__pyx_kp_u_and;
3913 : PyObject *__pyx_kp_u_are_allowed_Using_default;
3914 : PyObject *__pyx_n_s_astart;
3915 : PyObject *__pyx_n_s_astart_ptr;
3916 : PyObject *__pyx_n_s_asyncio_coroutines;
3917 : PyObject *__pyx_n_s_avalue;
3918 : PyObject *__pyx_n_s_avalue_ptr;
3919 : PyObject *__pyx_n_s_base;
3920 : PyObject *__pyx_n_s_basis;
3921 : PyObject *__pyx_kp_u_but_only_True_or_False_is_allow;
3922 : PyObject *__pyx_kp_u_but_only_values_in;
3923 : PyObject *__pyx_kp_u_but_only_values_in_s_are_allowed;
3924 : PyObject *__pyx_kp_u_but_this_is_an_invalid_value_s;
3925 : PyObject *__pyx_kp_u_but_this_is_not_a_valid_value_S;
3926 : PyObject *__pyx_n_s_c;
3927 : PyObject *__pyx_n_u_c;
3928 : PyObject *__pyx_n_s_class;
3929 : PyObject *__pyx_n_s_class_getitem;
3930 : PyObject *__pyx_n_s_cline_in_traceback;
3931 : PyObject *__pyx_n_s_colcost_ptr;
3932 : PyObject *__pyx_n_s_collections;
3933 : PyObject *__pyx_kp_s_collections_abc;
3934 : PyObject *__pyx_n_s_collower_ptr;
3935 : PyObject *__pyx_n_s_colupper_ptr;
3936 : PyObject *__pyx_kp_s_contiguous_and_direct;
3937 : PyObject *__pyx_kp_s_contiguous_and_indirect;
3938 : PyObject *__pyx_n_s_count;
3939 : PyObject *__pyx_n_u_crossover_nit;
3940 : PyObject *__pyx_n_u_d;
3941 : PyObject *__pyx_n_s_dict;
3942 : PyObject *__pyx_kp_u_disable;
3943 : PyObject *__pyx_n_s_dtype_is_object;
3944 : PyObject *__pyx_n_u_dual_feasibility_tolerance;
3945 : PyObject *__pyx_n_u_dual_objective_value_upper_bound;
3946 : PyObject *__pyx_n_u_dual_simplex_cleanup_strategy;
3947 : PyObject *__pyx_n_u_dual_simplex_cost_perturbation_m;
3948 : PyObject *__pyx_n_u_dual_steepest_edge_weight_log_er;
3949 : PyObject *__pyx_kp_u_enable;
3950 : PyObject *__pyx_n_s_encode;
3951 : PyObject *__pyx_n_s_enumerate;
3952 : PyObject *__pyx_n_s_err_model_status;
3953 : PyObject *__pyx_n_s_error;
3954 : PyObject *__pyx_n_s_flags;
3955 : PyObject *__pyx_n_s_format;
3956 : PyObject *__pyx_n_s_fortran;
3957 : PyObject *__pyx_n_u_fortran;
3958 : PyObject *__pyx_n_u_fun;
3959 : PyObject *__pyx_kp_u_gc;
3960 : PyObject *__pyx_n_s_get;
3961 : PyObject *__pyx_n_s_getstate;
3962 : PyObject *__pyx_kp_u_got;
3963 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
3964 : PyObject *__pyx_n_s_highs;
3965 : PyObject *__pyx_n_u_highs_debug_level;
3966 : PyObject *__pyx_n_s_highs_wrapper;
3967 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
3968 : PyObject *__pyx_n_s_id;
3969 : PyObject *__pyx_n_s_ii;
3970 : PyObject *__pyx_n_s_import;
3971 : PyObject *__pyx_n_s_index;
3972 : PyObject *__pyx_n_u_infinite_bound;
3973 : PyObject *__pyx_n_u_infinite_cost;
3974 : PyObject *__pyx_n_s_info;
3975 : PyObject *__pyx_n_s_init_status;
3976 : PyObject *__pyx_n_s_initializing;
3977 : PyObject *__pyx_n_s_integrality;
3978 : PyObject *__pyx_n_s_integrality_ptr;
3979 : PyObject *__pyx_n_u_ipm_iteration_limit;
3980 : PyObject *__pyx_n_u_ipm_nit;
3981 : PyObject *__pyx_n_u_ipm_optimality_tolerance;
3982 : PyObject *__pyx_kp_u_is;
3983 : PyObject *__pyx_n_s_is_coroutine;
3984 : PyObject *__pyx_kp_u_isenabled;
3985 : PyObject *__pyx_n_s_itemsize;
3986 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3987 : PyObject *__pyx_n_u_keep_n_rows;
3988 : PyObject *__pyx_n_u_lambda;
3989 : PyObject *__pyx_n_u_large_matrix_value;
3990 : PyObject *__pyx_n_s_lb;
3991 : PyObject *__pyx_n_u_less_infeasible_DSE_check;
3992 : PyObject *__pyx_n_u_less_infeasible_DSE_choose_row;
3993 : PyObject *__pyx_n_s_lhs;
3994 : PyObject *__pyx_n_u_log_to_console;
3995 : PyObject *__pyx_n_s_lp;
3996 : PyObject *__pyx_n_s_lpFailCondition;
3997 : PyObject *__pyx_n_s_main;
3998 : PyObject *__pyx_n_s_marg_bnds;
3999 : PyObject *__pyx_n_u_marg_bnds;
4000 : PyObject *__pyx_n_s_memview;
4001 : PyObject *__pyx_n_u_message;
4002 : PyObject *__pyx_n_s_mipFailCondition;
4003 : PyObject *__pyx_n_u_mip_dual_bound;
4004 : PyObject *__pyx_n_u_mip_gap;
4005 : PyObject *__pyx_n_u_mip_max_nodes;
4006 : PyObject *__pyx_n_u_mip_node_count;
4007 : PyObject *__pyx_n_u_mip_rel_gap;
4008 : PyObject *__pyx_n_s_mode;
4009 : PyObject *__pyx_n_s_model_status;
4010 : PyObject *__pyx_kp_u_model_status_is;
4011 : PyObject *__pyx_n_u_mps_parser_type_free;
4012 : PyObject *__pyx_n_s_name;
4013 : PyObject *__pyx_n_s_name_2;
4014 : PyObject *__pyx_n_s_ndim;
4015 : PyObject *__pyx_n_s_new;
4016 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4017 : PyObject *__pyx_n_s_np;
4018 : PyObject *__pyx_n_s_numbers;
4019 : PyObject *__pyx_n_s_numcol;
4020 : PyObject *__pyx_n_s_numintegrality;
4021 : PyObject *__pyx_n_s_numnz;
4022 : PyObject *__pyx_n_s_numpy;
4023 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
4024 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
4025 : PyObject *__pyx_n_s_numrow;
4026 : PyObject *__pyx_n_s_obj;
4027 : PyObject *__pyx_n_b_off;
4028 : PyObject *__pyx_n_b_on;
4029 : PyObject *__pyx_n_s_options;
4030 : PyObject *__pyx_n_u_output_flag;
4031 : PyObject *__pyx_n_s_pack;
4032 : PyObject *__pyx_n_u_parallel;
4033 : PyObject *__pyx_n_s_pickle;
4034 : PyObject *__pyx_n_u_presolve;
4035 : PyObject *__pyx_n_u_primal_feasibility_tolerance;
4036 : PyObject *__pyx_kp_u_primal_status_is;
4037 : PyObject *__pyx_n_s_pyx_PickleError;
4038 : PyObject *__pyx_n_s_pyx_checksum;
4039 : PyObject *__pyx_n_s_pyx_result;
4040 : PyObject *__pyx_n_s_pyx_state;
4041 : PyObject *__pyx_n_s_pyx_type;
4042 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
4043 : PyObject *__pyx_n_s_pyx_vtable;
4044 : PyObject *__pyx_n_s_range;
4045 : PyObject *__pyx_n_s_reduce;
4046 : PyObject *__pyx_n_s_reduce_cython;
4047 : PyObject *__pyx_n_s_reduce_ex;
4048 : PyObject *__pyx_n_s_register;
4049 : PyObject *__pyx_n_s_res;
4050 : PyObject *__pyx_n_s_rhs;
4051 : PyObject *__pyx_n_s_rowlower_ptr;
4052 : PyObject *__pyx_n_s_rowupper_ptr;
4053 : PyObject *__pyx_n_u_run_as_hsol;
4054 : PyObject *__pyx_n_u_run_crossover;
4055 : PyObject *__pyx_n_s_run_status;
4056 : PyObject *__pyx_n_s_scipy_optimize;
4057 : PyObject *__pyx_n_s_scipy_optimize__highs_cython_src;
4058 : PyObject *__pyx_n_s_setstate;
4059 : PyObject *__pyx_n_s_setstate_cython;
4060 : PyObject *__pyx_n_s_shape;
4061 : PyObject *__pyx_n_u_simplex_crash_strategy;
4062 : PyObject *__pyx_n_u_simplex_dual_edge_weight_strateg;
4063 : PyObject *__pyx_n_u_simplex_dualise_strategy;
4064 : PyObject *__pyx_n_u_simplex_initial_condition_check;
4065 : PyObject *__pyx_n_u_simplex_initial_condition_tolera;
4066 : PyObject *__pyx_n_u_simplex_iteration_limit;
4067 : PyObject *__pyx_n_u_simplex_nit;
4068 : PyObject *__pyx_n_u_simplex_permute_strategy;
4069 : PyObject *__pyx_n_u_simplex_price_strategy;
4070 : PyObject *__pyx_n_u_simplex_primal_edge_weight_strat;
4071 : PyObject *__pyx_n_u_simplex_scale_strategy;
4072 : PyObject *__pyx_n_u_simplex_strategy;
4073 : PyObject *__pyx_n_u_simplex_update_limit;
4074 : PyObject *__pyx_n_s_size;
4075 : PyObject *__pyx_n_u_slack;
4076 : PyObject *__pyx_n_u_small_matrix_value;
4077 : PyObject *__pyx_n_s_solution;
4078 : PyObject *__pyx_n_u_solver;
4079 : PyObject *__pyx_n_s_spec;
4080 : PyObject *__pyx_n_s_start;
4081 : PyObject *__pyx_n_u_start_crossover_tolerance;
4082 : PyObject *__pyx_n_u_status;
4083 : PyObject *__pyx_n_s_step;
4084 : PyObject *__pyx_n_s_stop;
4085 : PyObject *__pyx_kp_s_strided_and_direct;
4086 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4087 : PyObject *__pyx_kp_s_strided_and_indirect;
4088 : PyObject *__pyx_kp_s_stringsource;
4089 : PyObject *__pyx_n_s_struct;
4090 : PyObject *__pyx_n_s_sys;
4091 : PyObject *__pyx_n_s_test;
4092 : PyObject *__pyx_n_u_threads;
4093 : PyObject *__pyx_n_u_time_limit;
4094 : PyObject *__pyx_n_s_ub;
4095 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4096 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4097 : PyObject *__pyx_n_s_unpack;
4098 : PyObject *__pyx_n_s_update;
4099 : PyObject *__pyx_n_u_use_original_HFactor_logic;
4100 : PyObject *__pyx_n_s_version_info;
4101 : PyObject *__pyx_n_s_warn;
4102 : PyObject *__pyx_n_s_warnings;
4103 : PyObject *__pyx_n_u_x;
4104 : PyObject *__pyx_n_s_zeros;
4105 : PyObject *__pyx_int_0;
4106 : PyObject *__pyx_int_1;
4107 : PyObject *__pyx_int_2;
4108 : PyObject *__pyx_int_3;
4109 : PyObject *__pyx_int_10;
4110 : PyObject *__pyx_int_112105877;
4111 : PyObject *__pyx_int_136983863;
4112 : PyObject *__pyx_int_184977713;
4113 : PyObject *__pyx_int_neg_1;
4114 : PyObject *__pyx_slice__5;
4115 : PyObject *__pyx_tuple__4;
4116 : PyObject *__pyx_tuple__8;
4117 : PyObject *__pyx_tuple__9;
4118 : PyObject *__pyx_tuple__10;
4119 : PyObject *__pyx_tuple__15;
4120 : PyObject *__pyx_tuple__16;
4121 : PyObject *__pyx_tuple__17;
4122 : PyObject *__pyx_tuple__18;
4123 : PyObject *__pyx_tuple__19;
4124 : PyObject *__pyx_tuple__20;
4125 : PyObject *__pyx_tuple__21;
4126 : PyObject *__pyx_tuple__22;
4127 : PyObject *__pyx_tuple__23;
4128 : PyObject *__pyx_tuple__24;
4129 : PyObject *__pyx_tuple__26;
4130 : PyObject *__pyx_codeobj__25;
4131 : PyObject *__pyx_codeobj__27;
4132 : } __pyx_mstate;
4133 :
4134 : #if CYTHON_USE_MODULE_STATE
4135 : #ifdef __cplusplus
4136 : namespace {
4137 : extern struct PyModuleDef __pyx_moduledef;
4138 : } /* anonymous namespace */
4139 : #else
4140 : static struct PyModuleDef __pyx_moduledef;
4141 : #endif
4142 :
4143 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
4144 :
4145 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
4146 :
4147 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
4148 : #else
4149 : static __pyx_mstate __pyx_mstate_global_static =
4150 : #ifdef __cplusplus
4151 : {};
4152 : #else
4153 : {0};
4154 : #endif
4155 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
4156 : #endif
4157 : /* #### Code section: module_state_clear ### */
4158 : #if CYTHON_USE_MODULE_STATE
4159 : static int __pyx_m_clear(PyObject *m) {
4160 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
4161 : if (!clear_module_state) return 0;
4162 : Py_CLEAR(clear_module_state->__pyx_d);
4163 : Py_CLEAR(clear_module_state->__pyx_b);
4164 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4165 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4166 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4167 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4168 : #ifdef __Pyx_CyFunction_USED
4169 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4170 : #endif
4171 : #ifdef __Pyx_FusedFunction_USED
4172 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
4173 : #endif
4174 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4175 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4176 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4177 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4178 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4179 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4180 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4181 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4182 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4183 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4184 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4185 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4186 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4187 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4188 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4189 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4190 : Py_CLEAR(clear_module_state->__pyx_array_type);
4191 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4192 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4193 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4194 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4195 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4196 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4197 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4198 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
4199 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
4200 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4201 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
4202 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4203 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4204 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4205 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4206 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
4207 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4208 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4209 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
4210 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4211 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
4212 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4213 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
4214 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4215 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4216 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4217 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4218 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
4219 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4220 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
4221 : Py_CLEAR(clear_module_state->__pyx_n_s_Number);
4222 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
4223 : Py_CLEAR(clear_module_state->__pyx_n_s_OptimizeWarning);
4224 : Py_CLEAR(clear_module_state->__pyx_kp_u_Option);
4225 : Py_CLEAR(clear_module_state->__pyx_kp_u_Option_s_is_s_but_only_values_in);
4226 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4227 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
4228 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
4229 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4230 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
4231 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4232 : Py_CLEAR(clear_module_state->__pyx_kp_u_Using_default);
4233 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
4234 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
4235 : Py_CLEAR(clear_module_state->__pyx_kp_u__11);
4236 : Py_CLEAR(clear_module_state->__pyx_kp_u__12);
4237 : Py_CLEAR(clear_module_state->__pyx_kp_u__13);
4238 : Py_CLEAR(clear_module_state->__pyx_kp_u__14);
4239 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
4240 : Py_CLEAR(clear_module_state->__pyx_n_s__28);
4241 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
4242 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
4243 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
4244 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
4245 : Py_CLEAR(clear_module_state->__pyx_n_s_aindex);
4246 : Py_CLEAR(clear_module_state->__pyx_n_s_aindex_ptr);
4247 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
4248 : Py_CLEAR(clear_module_state->__pyx_n_u_allowed_simplex_cost_scale_facto);
4249 : Py_CLEAR(clear_module_state->__pyx_n_u_allowed_simplex_matrix_scale_fac);
4250 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
4251 : Py_CLEAR(clear_module_state->__pyx_kp_u_are_allowed_Using_default);
4252 : Py_CLEAR(clear_module_state->__pyx_n_s_astart);
4253 : Py_CLEAR(clear_module_state->__pyx_n_s_astart_ptr);
4254 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
4255 : Py_CLEAR(clear_module_state->__pyx_n_s_avalue);
4256 : Py_CLEAR(clear_module_state->__pyx_n_s_avalue_ptr);
4257 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
4258 : Py_CLEAR(clear_module_state->__pyx_n_s_basis);
4259 : Py_CLEAR(clear_module_state->__pyx_kp_u_but_only_True_or_False_is_allow);
4260 : Py_CLEAR(clear_module_state->__pyx_kp_u_but_only_values_in);
4261 : Py_CLEAR(clear_module_state->__pyx_kp_u_but_only_values_in_s_are_allowed);
4262 : Py_CLEAR(clear_module_state->__pyx_kp_u_but_this_is_an_invalid_value_s);
4263 : Py_CLEAR(clear_module_state->__pyx_kp_u_but_this_is_not_a_valid_value_S);
4264 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
4265 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
4266 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
4267 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
4268 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
4269 : Py_CLEAR(clear_module_state->__pyx_n_s_colcost_ptr);
4270 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
4271 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
4272 : Py_CLEAR(clear_module_state->__pyx_n_s_collower_ptr);
4273 : Py_CLEAR(clear_module_state->__pyx_n_s_colupper_ptr);
4274 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
4275 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
4276 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
4277 : Py_CLEAR(clear_module_state->__pyx_n_u_crossover_nit);
4278 : Py_CLEAR(clear_module_state->__pyx_n_u_d);
4279 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
4280 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
4281 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
4282 : Py_CLEAR(clear_module_state->__pyx_n_u_dual_feasibility_tolerance);
4283 : Py_CLEAR(clear_module_state->__pyx_n_u_dual_objective_value_upper_bound);
4284 : Py_CLEAR(clear_module_state->__pyx_n_u_dual_simplex_cleanup_strategy);
4285 : Py_CLEAR(clear_module_state->__pyx_n_u_dual_simplex_cost_perturbation_m);
4286 : Py_CLEAR(clear_module_state->__pyx_n_u_dual_steepest_edge_weight_log_er);
4287 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
4288 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
4289 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
4290 : Py_CLEAR(clear_module_state->__pyx_n_s_err_model_status);
4291 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
4292 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
4293 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
4294 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
4295 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
4296 : Py_CLEAR(clear_module_state->__pyx_n_u_fun);
4297 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
4298 : Py_CLEAR(clear_module_state->__pyx_n_s_get);
4299 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
4300 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
4301 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4302 : Py_CLEAR(clear_module_state->__pyx_n_s_highs);
4303 : Py_CLEAR(clear_module_state->__pyx_n_u_highs_debug_level);
4304 : Py_CLEAR(clear_module_state->__pyx_n_s_highs_wrapper);
4305 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4306 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
4307 : Py_CLEAR(clear_module_state->__pyx_n_s_ii);
4308 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
4309 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
4310 : Py_CLEAR(clear_module_state->__pyx_n_u_infinite_bound);
4311 : Py_CLEAR(clear_module_state->__pyx_n_u_infinite_cost);
4312 : Py_CLEAR(clear_module_state->__pyx_n_s_info);
4313 : Py_CLEAR(clear_module_state->__pyx_n_s_init_status);
4314 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
4315 : Py_CLEAR(clear_module_state->__pyx_n_s_integrality);
4316 : Py_CLEAR(clear_module_state->__pyx_n_s_integrality_ptr);
4317 : Py_CLEAR(clear_module_state->__pyx_n_u_ipm_iteration_limit);
4318 : Py_CLEAR(clear_module_state->__pyx_n_u_ipm_nit);
4319 : Py_CLEAR(clear_module_state->__pyx_n_u_ipm_optimality_tolerance);
4320 : Py_CLEAR(clear_module_state->__pyx_kp_u_is);
4321 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
4322 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
4323 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
4324 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4325 : Py_CLEAR(clear_module_state->__pyx_n_u_keep_n_rows);
4326 : Py_CLEAR(clear_module_state->__pyx_n_u_lambda);
4327 : Py_CLEAR(clear_module_state->__pyx_n_u_large_matrix_value);
4328 : Py_CLEAR(clear_module_state->__pyx_n_s_lb);
4329 : Py_CLEAR(clear_module_state->__pyx_n_u_less_infeasible_DSE_check);
4330 : Py_CLEAR(clear_module_state->__pyx_n_u_less_infeasible_DSE_choose_row);
4331 : Py_CLEAR(clear_module_state->__pyx_n_s_lhs);
4332 : Py_CLEAR(clear_module_state->__pyx_n_u_log_to_console);
4333 : Py_CLEAR(clear_module_state->__pyx_n_s_lp);
4334 : Py_CLEAR(clear_module_state->__pyx_n_s_lpFailCondition);
4335 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
4336 : Py_CLEAR(clear_module_state->__pyx_n_s_marg_bnds);
4337 : Py_CLEAR(clear_module_state->__pyx_n_u_marg_bnds);
4338 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
4339 : Py_CLEAR(clear_module_state->__pyx_n_u_message);
4340 : Py_CLEAR(clear_module_state->__pyx_n_s_mipFailCondition);
4341 : Py_CLEAR(clear_module_state->__pyx_n_u_mip_dual_bound);
4342 : Py_CLEAR(clear_module_state->__pyx_n_u_mip_gap);
4343 : Py_CLEAR(clear_module_state->__pyx_n_u_mip_max_nodes);
4344 : Py_CLEAR(clear_module_state->__pyx_n_u_mip_node_count);
4345 : Py_CLEAR(clear_module_state->__pyx_n_u_mip_rel_gap);
4346 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4347 : Py_CLEAR(clear_module_state->__pyx_n_s_model_status);
4348 : Py_CLEAR(clear_module_state->__pyx_kp_u_model_status_is);
4349 : Py_CLEAR(clear_module_state->__pyx_n_u_mps_parser_type_free);
4350 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4351 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4352 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4353 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4354 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4355 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4356 : Py_CLEAR(clear_module_state->__pyx_n_s_numbers);
4357 : Py_CLEAR(clear_module_state->__pyx_n_s_numcol);
4358 : Py_CLEAR(clear_module_state->__pyx_n_s_numintegrality);
4359 : Py_CLEAR(clear_module_state->__pyx_n_s_numnz);
4360 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4361 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4362 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4363 : Py_CLEAR(clear_module_state->__pyx_n_s_numrow);
4364 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4365 : Py_CLEAR(clear_module_state->__pyx_n_b_off);
4366 : Py_CLEAR(clear_module_state->__pyx_n_b_on);
4367 : Py_CLEAR(clear_module_state->__pyx_n_s_options);
4368 : Py_CLEAR(clear_module_state->__pyx_n_u_output_flag);
4369 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4370 : Py_CLEAR(clear_module_state->__pyx_n_u_parallel);
4371 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4372 : Py_CLEAR(clear_module_state->__pyx_n_u_presolve);
4373 : Py_CLEAR(clear_module_state->__pyx_n_u_primal_feasibility_tolerance);
4374 : Py_CLEAR(clear_module_state->__pyx_kp_u_primal_status_is);
4375 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4376 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4377 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4378 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4379 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4380 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4381 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4382 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4383 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4384 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4385 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4386 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4387 : Py_CLEAR(clear_module_state->__pyx_n_s_res);
4388 : Py_CLEAR(clear_module_state->__pyx_n_s_rhs);
4389 : Py_CLEAR(clear_module_state->__pyx_n_s_rowlower_ptr);
4390 : Py_CLEAR(clear_module_state->__pyx_n_s_rowupper_ptr);
4391 : Py_CLEAR(clear_module_state->__pyx_n_u_run_as_hsol);
4392 : Py_CLEAR(clear_module_state->__pyx_n_u_run_crossover);
4393 : Py_CLEAR(clear_module_state->__pyx_n_s_run_status);
4394 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_optimize);
4395 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_optimize__highs_cython_src);
4396 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4397 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4398 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4399 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_crash_strategy);
4400 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_dual_edge_weight_strateg);
4401 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_dualise_strategy);
4402 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_initial_condition_check);
4403 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_initial_condition_tolera);
4404 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_iteration_limit);
4405 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_nit);
4406 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_permute_strategy);
4407 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_price_strategy);
4408 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_primal_edge_weight_strat);
4409 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_scale_strategy);
4410 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_strategy);
4411 : Py_CLEAR(clear_module_state->__pyx_n_u_simplex_update_limit);
4412 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4413 : Py_CLEAR(clear_module_state->__pyx_n_u_slack);
4414 : Py_CLEAR(clear_module_state->__pyx_n_u_small_matrix_value);
4415 : Py_CLEAR(clear_module_state->__pyx_n_s_solution);
4416 : Py_CLEAR(clear_module_state->__pyx_n_u_solver);
4417 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4418 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4419 : Py_CLEAR(clear_module_state->__pyx_n_u_start_crossover_tolerance);
4420 : Py_CLEAR(clear_module_state->__pyx_n_u_status);
4421 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4422 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4423 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4424 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4425 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4426 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4427 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4428 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4429 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4430 : Py_CLEAR(clear_module_state->__pyx_n_u_threads);
4431 : Py_CLEAR(clear_module_state->__pyx_n_u_time_limit);
4432 : Py_CLEAR(clear_module_state->__pyx_n_s_ub);
4433 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4434 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4435 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4436 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4437 : Py_CLEAR(clear_module_state->__pyx_n_u_use_original_HFactor_logic);
4438 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4439 : Py_CLEAR(clear_module_state->__pyx_n_s_warn);
4440 : Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
4441 : Py_CLEAR(clear_module_state->__pyx_n_u_x);
4442 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
4443 : Py_CLEAR(clear_module_state->__pyx_int_0);
4444 : Py_CLEAR(clear_module_state->__pyx_int_1);
4445 : Py_CLEAR(clear_module_state->__pyx_int_2);
4446 : Py_CLEAR(clear_module_state->__pyx_int_3);
4447 : Py_CLEAR(clear_module_state->__pyx_int_10);
4448 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4449 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4450 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4451 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4452 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4453 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4454 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4455 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4456 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
4457 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
4458 : Py_CLEAR(clear_module_state->__pyx_tuple__16);
4459 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
4460 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
4461 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
4462 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
4463 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
4464 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
4465 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
4466 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
4467 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
4468 : Py_CLEAR(clear_module_state->__pyx_codeobj__25);
4469 : Py_CLEAR(clear_module_state->__pyx_codeobj__27);
4470 : return 0;
4471 : }
4472 : #endif
4473 : /* #### Code section: module_state_traverse ### */
4474 : #if CYTHON_USE_MODULE_STATE
4475 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4476 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
4477 : if (!traverse_module_state) return 0;
4478 : Py_VISIT(traverse_module_state->__pyx_d);
4479 : Py_VISIT(traverse_module_state->__pyx_b);
4480 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4481 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
4482 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
4483 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
4484 : #ifdef __Pyx_CyFunction_USED
4485 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4486 : #endif
4487 : #ifdef __Pyx_FusedFunction_USED
4488 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
4489 : #endif
4490 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4491 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4492 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4493 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4494 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4495 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4496 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4497 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4498 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4499 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4500 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4501 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4502 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4503 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4504 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4505 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4506 : Py_VISIT(traverse_module_state->__pyx_array_type);
4507 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4508 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4509 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4510 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4511 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4512 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4513 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4514 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
4515 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
4516 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4517 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
4518 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4519 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4520 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4521 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4522 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
4523 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4524 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4525 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
4526 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4527 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
4528 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4529 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
4530 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4531 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4532 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4533 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4534 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4535 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4536 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
4537 : Py_VISIT(traverse_module_state->__pyx_n_s_Number);
4538 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
4539 : Py_VISIT(traverse_module_state->__pyx_n_s_OptimizeWarning);
4540 : Py_VISIT(traverse_module_state->__pyx_kp_u_Option);
4541 : Py_VISIT(traverse_module_state->__pyx_kp_u_Option_s_is_s_but_only_values_in);
4542 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4543 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
4544 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
4545 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4546 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4547 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4548 : Py_VISIT(traverse_module_state->__pyx_kp_u_Using_default);
4549 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
4550 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
4551 : Py_VISIT(traverse_module_state->__pyx_kp_u__11);
4552 : Py_VISIT(traverse_module_state->__pyx_kp_u__12);
4553 : Py_VISIT(traverse_module_state->__pyx_kp_u__13);
4554 : Py_VISIT(traverse_module_state->__pyx_kp_u__14);
4555 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
4556 : Py_VISIT(traverse_module_state->__pyx_n_s__28);
4557 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
4558 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
4559 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4560 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4561 : Py_VISIT(traverse_module_state->__pyx_n_s_aindex);
4562 : Py_VISIT(traverse_module_state->__pyx_n_s_aindex_ptr);
4563 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
4564 : Py_VISIT(traverse_module_state->__pyx_n_u_allowed_simplex_cost_scale_facto);
4565 : Py_VISIT(traverse_module_state->__pyx_n_u_allowed_simplex_matrix_scale_fac);
4566 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
4567 : Py_VISIT(traverse_module_state->__pyx_kp_u_are_allowed_Using_default);
4568 : Py_VISIT(traverse_module_state->__pyx_n_s_astart);
4569 : Py_VISIT(traverse_module_state->__pyx_n_s_astart_ptr);
4570 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4571 : Py_VISIT(traverse_module_state->__pyx_n_s_avalue);
4572 : Py_VISIT(traverse_module_state->__pyx_n_s_avalue_ptr);
4573 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
4574 : Py_VISIT(traverse_module_state->__pyx_n_s_basis);
4575 : Py_VISIT(traverse_module_state->__pyx_kp_u_but_only_True_or_False_is_allow);
4576 : Py_VISIT(traverse_module_state->__pyx_kp_u_but_only_values_in);
4577 : Py_VISIT(traverse_module_state->__pyx_kp_u_but_only_values_in_s_are_allowed);
4578 : Py_VISIT(traverse_module_state->__pyx_kp_u_but_this_is_an_invalid_value_s);
4579 : Py_VISIT(traverse_module_state->__pyx_kp_u_but_this_is_not_a_valid_value_S);
4580 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
4581 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
4582 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
4583 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
4584 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4585 : Py_VISIT(traverse_module_state->__pyx_n_s_colcost_ptr);
4586 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4587 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
4588 : Py_VISIT(traverse_module_state->__pyx_n_s_collower_ptr);
4589 : Py_VISIT(traverse_module_state->__pyx_n_s_colupper_ptr);
4590 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
4591 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
4592 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
4593 : Py_VISIT(traverse_module_state->__pyx_n_u_crossover_nit);
4594 : Py_VISIT(traverse_module_state->__pyx_n_u_d);
4595 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
4596 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4597 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
4598 : Py_VISIT(traverse_module_state->__pyx_n_u_dual_feasibility_tolerance);
4599 : Py_VISIT(traverse_module_state->__pyx_n_u_dual_objective_value_upper_bound);
4600 : Py_VISIT(traverse_module_state->__pyx_n_u_dual_simplex_cleanup_strategy);
4601 : Py_VISIT(traverse_module_state->__pyx_n_u_dual_simplex_cost_perturbation_m);
4602 : Py_VISIT(traverse_module_state->__pyx_n_u_dual_steepest_edge_weight_log_er);
4603 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4604 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
4605 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
4606 : Py_VISIT(traverse_module_state->__pyx_n_s_err_model_status);
4607 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
4608 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
4609 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
4610 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
4611 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
4612 : Py_VISIT(traverse_module_state->__pyx_n_u_fun);
4613 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4614 : Py_VISIT(traverse_module_state->__pyx_n_s_get);
4615 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4616 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
4617 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4618 : Py_VISIT(traverse_module_state->__pyx_n_s_highs);
4619 : Py_VISIT(traverse_module_state->__pyx_n_u_highs_debug_level);
4620 : Py_VISIT(traverse_module_state->__pyx_n_s_highs_wrapper);
4621 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4622 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
4623 : Py_VISIT(traverse_module_state->__pyx_n_s_ii);
4624 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
4625 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
4626 : Py_VISIT(traverse_module_state->__pyx_n_u_infinite_bound);
4627 : Py_VISIT(traverse_module_state->__pyx_n_u_infinite_cost);
4628 : Py_VISIT(traverse_module_state->__pyx_n_s_info);
4629 : Py_VISIT(traverse_module_state->__pyx_n_s_init_status);
4630 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4631 : Py_VISIT(traverse_module_state->__pyx_n_s_integrality);
4632 : Py_VISIT(traverse_module_state->__pyx_n_s_integrality_ptr);
4633 : Py_VISIT(traverse_module_state->__pyx_n_u_ipm_iteration_limit);
4634 : Py_VISIT(traverse_module_state->__pyx_n_u_ipm_nit);
4635 : Py_VISIT(traverse_module_state->__pyx_n_u_ipm_optimality_tolerance);
4636 : Py_VISIT(traverse_module_state->__pyx_kp_u_is);
4637 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4638 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4639 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
4640 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4641 : Py_VISIT(traverse_module_state->__pyx_n_u_keep_n_rows);
4642 : Py_VISIT(traverse_module_state->__pyx_n_u_lambda);
4643 : Py_VISIT(traverse_module_state->__pyx_n_u_large_matrix_value);
4644 : Py_VISIT(traverse_module_state->__pyx_n_s_lb);
4645 : Py_VISIT(traverse_module_state->__pyx_n_u_less_infeasible_DSE_check);
4646 : Py_VISIT(traverse_module_state->__pyx_n_u_less_infeasible_DSE_choose_row);
4647 : Py_VISIT(traverse_module_state->__pyx_n_s_lhs);
4648 : Py_VISIT(traverse_module_state->__pyx_n_u_log_to_console);
4649 : Py_VISIT(traverse_module_state->__pyx_n_s_lp);
4650 : Py_VISIT(traverse_module_state->__pyx_n_s_lpFailCondition);
4651 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
4652 : Py_VISIT(traverse_module_state->__pyx_n_s_marg_bnds);
4653 : Py_VISIT(traverse_module_state->__pyx_n_u_marg_bnds);
4654 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
4655 : Py_VISIT(traverse_module_state->__pyx_n_u_message);
4656 : Py_VISIT(traverse_module_state->__pyx_n_s_mipFailCondition);
4657 : Py_VISIT(traverse_module_state->__pyx_n_u_mip_dual_bound);
4658 : Py_VISIT(traverse_module_state->__pyx_n_u_mip_gap);
4659 : Py_VISIT(traverse_module_state->__pyx_n_u_mip_max_nodes);
4660 : Py_VISIT(traverse_module_state->__pyx_n_u_mip_node_count);
4661 : Py_VISIT(traverse_module_state->__pyx_n_u_mip_rel_gap);
4662 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
4663 : Py_VISIT(traverse_module_state->__pyx_n_s_model_status);
4664 : Py_VISIT(traverse_module_state->__pyx_kp_u_model_status_is);
4665 : Py_VISIT(traverse_module_state->__pyx_n_u_mps_parser_type_free);
4666 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
4667 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
4668 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
4669 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
4670 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4671 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
4672 : Py_VISIT(traverse_module_state->__pyx_n_s_numbers);
4673 : Py_VISIT(traverse_module_state->__pyx_n_s_numcol);
4674 : Py_VISIT(traverse_module_state->__pyx_n_s_numintegrality);
4675 : Py_VISIT(traverse_module_state->__pyx_n_s_numnz);
4676 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
4677 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4678 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4679 : Py_VISIT(traverse_module_state->__pyx_n_s_numrow);
4680 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
4681 : Py_VISIT(traverse_module_state->__pyx_n_b_off);
4682 : Py_VISIT(traverse_module_state->__pyx_n_b_on);
4683 : Py_VISIT(traverse_module_state->__pyx_n_s_options);
4684 : Py_VISIT(traverse_module_state->__pyx_n_u_output_flag);
4685 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
4686 : Py_VISIT(traverse_module_state->__pyx_n_u_parallel);
4687 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
4688 : Py_VISIT(traverse_module_state->__pyx_n_u_presolve);
4689 : Py_VISIT(traverse_module_state->__pyx_n_u_primal_feasibility_tolerance);
4690 : Py_VISIT(traverse_module_state->__pyx_kp_u_primal_status_is);
4691 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
4692 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
4693 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
4694 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4695 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
4696 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
4697 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4698 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
4699 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4700 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4701 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4702 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
4703 : Py_VISIT(traverse_module_state->__pyx_n_s_res);
4704 : Py_VISIT(traverse_module_state->__pyx_n_s_rhs);
4705 : Py_VISIT(traverse_module_state->__pyx_n_s_rowlower_ptr);
4706 : Py_VISIT(traverse_module_state->__pyx_n_s_rowupper_ptr);
4707 : Py_VISIT(traverse_module_state->__pyx_n_u_run_as_hsol);
4708 : Py_VISIT(traverse_module_state->__pyx_n_u_run_crossover);
4709 : Py_VISIT(traverse_module_state->__pyx_n_s_run_status);
4710 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_optimize);
4711 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_optimize__highs_cython_src);
4712 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4713 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4714 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
4715 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_crash_strategy);
4716 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_dual_edge_weight_strateg);
4717 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_dualise_strategy);
4718 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_initial_condition_check);
4719 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_initial_condition_tolera);
4720 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_iteration_limit);
4721 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_nit);
4722 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_permute_strategy);
4723 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_price_strategy);
4724 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_primal_edge_weight_strat);
4725 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_scale_strategy);
4726 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_strategy);
4727 : Py_VISIT(traverse_module_state->__pyx_n_u_simplex_update_limit);
4728 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
4729 : Py_VISIT(traverse_module_state->__pyx_n_u_slack);
4730 : Py_VISIT(traverse_module_state->__pyx_n_u_small_matrix_value);
4731 : Py_VISIT(traverse_module_state->__pyx_n_s_solution);
4732 : Py_VISIT(traverse_module_state->__pyx_n_u_solver);
4733 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4734 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
4735 : Py_VISIT(traverse_module_state->__pyx_n_u_start_crossover_tolerance);
4736 : Py_VISIT(traverse_module_state->__pyx_n_u_status);
4737 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
4738 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
4739 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
4740 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4741 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
4742 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4743 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4744 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4745 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
4746 : Py_VISIT(traverse_module_state->__pyx_n_u_threads);
4747 : Py_VISIT(traverse_module_state->__pyx_n_u_time_limit);
4748 : Py_VISIT(traverse_module_state->__pyx_n_s_ub);
4749 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4750 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4751 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
4752 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
4753 : Py_VISIT(traverse_module_state->__pyx_n_u_use_original_HFactor_logic);
4754 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
4755 : Py_VISIT(traverse_module_state->__pyx_n_s_warn);
4756 : Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
4757 : Py_VISIT(traverse_module_state->__pyx_n_u_x);
4758 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
4759 : Py_VISIT(traverse_module_state->__pyx_int_0);
4760 : Py_VISIT(traverse_module_state->__pyx_int_1);
4761 : Py_VISIT(traverse_module_state->__pyx_int_2);
4762 : Py_VISIT(traverse_module_state->__pyx_int_3);
4763 : Py_VISIT(traverse_module_state->__pyx_int_10);
4764 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
4765 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
4766 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
4767 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
4768 : Py_VISIT(traverse_module_state->__pyx_slice__5);
4769 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
4770 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
4771 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
4772 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
4773 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
4774 : Py_VISIT(traverse_module_state->__pyx_tuple__16);
4775 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
4776 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
4777 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
4778 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
4779 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
4780 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
4781 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
4782 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
4783 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
4784 : Py_VISIT(traverse_module_state->__pyx_codeobj__25);
4785 : Py_VISIT(traverse_module_state->__pyx_codeobj__27);
4786 : return 0;
4787 : }
4788 : #endif
4789 : /* #### Code section: module_state_defines ### */
4790 : #define __pyx_d __pyx_mstate_global->__pyx_d
4791 : #define __pyx_b __pyx_mstate_global->__pyx_b
4792 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
4793 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
4794 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
4795 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
4796 : #ifdef __Pyx_CyFunction_USED
4797 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
4798 : #endif
4799 : #ifdef __Pyx_FusedFunction_USED
4800 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
4801 : #endif
4802 : #ifdef __Pyx_Generator_USED
4803 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
4804 : #endif
4805 : #ifdef __Pyx_IterableCoroutine_USED
4806 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
4807 : #endif
4808 : #ifdef __Pyx_Coroutine_USED
4809 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
4810 : #endif
4811 : #ifdef __Pyx_Coroutine_USED
4812 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
4813 : #endif
4814 : #if CYTHON_USE_MODULE_STATE
4815 : #endif
4816 : #if CYTHON_USE_MODULE_STATE
4817 : #endif
4818 : #if CYTHON_USE_MODULE_STATE
4819 : #endif
4820 : #if CYTHON_USE_MODULE_STATE
4821 : #endif
4822 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
4823 : #if CYTHON_USE_MODULE_STATE
4824 : #endif
4825 : #if CYTHON_USE_MODULE_STATE
4826 : #endif
4827 : #if CYTHON_USE_MODULE_STATE
4828 : #endif
4829 : #if CYTHON_USE_MODULE_STATE
4830 : #endif
4831 : #if CYTHON_USE_MODULE_STATE
4832 : #endif
4833 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
4834 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
4835 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
4836 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
4837 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
4838 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
4839 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
4840 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
4841 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
4842 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
4843 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
4844 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
4845 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
4846 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
4847 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
4848 : #if CYTHON_USE_MODULE_STATE
4849 : #endif
4850 : #if CYTHON_USE_MODULE_STATE
4851 : #endif
4852 : #if CYTHON_USE_MODULE_STATE
4853 : #endif
4854 : #if CYTHON_USE_MODULE_STATE
4855 : #endif
4856 : #if CYTHON_USE_MODULE_STATE
4857 : #endif
4858 : #if CYTHON_USE_MODULE_STATE
4859 : #endif
4860 : #if CYTHON_USE_MODULE_STATE
4861 : #endif
4862 : #if CYTHON_USE_MODULE_STATE
4863 : #endif
4864 : #if CYTHON_USE_MODULE_STATE
4865 : #endif
4866 : #if CYTHON_USE_MODULE_STATE
4867 : #endif
4868 : #if CYTHON_USE_MODULE_STATE
4869 : #endif
4870 : #if CYTHON_USE_MODULE_STATE
4871 : #endif
4872 : #if CYTHON_USE_MODULE_STATE
4873 : #endif
4874 : #if CYTHON_USE_MODULE_STATE
4875 : #endif
4876 : #if CYTHON_USE_MODULE_STATE
4877 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
4878 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
4879 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
4880 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
4881 : #endif
4882 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
4883 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
4884 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
4885 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
4886 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
4887 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
4888 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
4889 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
4890 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
4891 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
4892 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
4893 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
4894 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
4895 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
4896 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
4897 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
4898 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
4899 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
4900 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
4901 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
4902 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
4903 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
4904 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
4905 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
4906 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
4907 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
4908 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
4909 : #define __pyx_n_s_Number __pyx_mstate_global->__pyx_n_s_Number
4910 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
4911 : #define __pyx_n_s_OptimizeWarning __pyx_mstate_global->__pyx_n_s_OptimizeWarning
4912 : #define __pyx_kp_u_Option __pyx_mstate_global->__pyx_kp_u_Option
4913 : #define __pyx_kp_u_Option_s_is_s_but_only_values_in __pyx_mstate_global->__pyx_kp_u_Option_s_is_s_but_only_values_in
4914 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
4915 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
4916 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
4917 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
4918 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
4919 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
4920 : #define __pyx_kp_u_Using_default __pyx_mstate_global->__pyx_kp_u_Using_default
4921 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
4922 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
4923 : #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11
4924 : #define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12
4925 : #define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13
4926 : #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
4927 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
4928 : #define __pyx_n_s__28 __pyx_mstate_global->__pyx_n_s__28
4929 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
4930 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
4931 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
4932 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
4933 : #define __pyx_n_s_aindex __pyx_mstate_global->__pyx_n_s_aindex
4934 : #define __pyx_n_s_aindex_ptr __pyx_mstate_global->__pyx_n_s_aindex_ptr
4935 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
4936 : #define __pyx_n_u_allowed_simplex_cost_scale_facto __pyx_mstate_global->__pyx_n_u_allowed_simplex_cost_scale_facto
4937 : #define __pyx_n_u_allowed_simplex_matrix_scale_fac __pyx_mstate_global->__pyx_n_u_allowed_simplex_matrix_scale_fac
4938 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
4939 : #define __pyx_kp_u_are_allowed_Using_default __pyx_mstate_global->__pyx_kp_u_are_allowed_Using_default
4940 : #define __pyx_n_s_astart __pyx_mstate_global->__pyx_n_s_astart
4941 : #define __pyx_n_s_astart_ptr __pyx_mstate_global->__pyx_n_s_astart_ptr
4942 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
4943 : #define __pyx_n_s_avalue __pyx_mstate_global->__pyx_n_s_avalue
4944 : #define __pyx_n_s_avalue_ptr __pyx_mstate_global->__pyx_n_s_avalue_ptr
4945 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
4946 : #define __pyx_n_s_basis __pyx_mstate_global->__pyx_n_s_basis
4947 : #define __pyx_kp_u_but_only_True_or_False_is_allow __pyx_mstate_global->__pyx_kp_u_but_only_True_or_False_is_allow
4948 : #define __pyx_kp_u_but_only_values_in __pyx_mstate_global->__pyx_kp_u_but_only_values_in
4949 : #define __pyx_kp_u_but_only_values_in_s_are_allowed __pyx_mstate_global->__pyx_kp_u_but_only_values_in_s_are_allowed
4950 : #define __pyx_kp_u_but_this_is_an_invalid_value_s __pyx_mstate_global->__pyx_kp_u_but_this_is_an_invalid_value_s
4951 : #define __pyx_kp_u_but_this_is_not_a_valid_value_S __pyx_mstate_global->__pyx_kp_u_but_this_is_not_a_valid_value_S
4952 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
4953 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
4954 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
4955 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
4956 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4957 : #define __pyx_n_s_colcost_ptr __pyx_mstate_global->__pyx_n_s_colcost_ptr
4958 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
4959 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
4960 : #define __pyx_n_s_collower_ptr __pyx_mstate_global->__pyx_n_s_collower_ptr
4961 : #define __pyx_n_s_colupper_ptr __pyx_mstate_global->__pyx_n_s_colupper_ptr
4962 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
4963 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
4964 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
4965 : #define __pyx_n_u_crossover_nit __pyx_mstate_global->__pyx_n_u_crossover_nit
4966 : #define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d
4967 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
4968 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
4969 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
4970 : #define __pyx_n_u_dual_feasibility_tolerance __pyx_mstate_global->__pyx_n_u_dual_feasibility_tolerance
4971 : #define __pyx_n_u_dual_objective_value_upper_bound __pyx_mstate_global->__pyx_n_u_dual_objective_value_upper_bound
4972 : #define __pyx_n_u_dual_simplex_cleanup_strategy __pyx_mstate_global->__pyx_n_u_dual_simplex_cleanup_strategy
4973 : #define __pyx_n_u_dual_simplex_cost_perturbation_m __pyx_mstate_global->__pyx_n_u_dual_simplex_cost_perturbation_m
4974 : #define __pyx_n_u_dual_steepest_edge_weight_log_er __pyx_mstate_global->__pyx_n_u_dual_steepest_edge_weight_log_er
4975 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
4976 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
4977 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
4978 : #define __pyx_n_s_err_model_status __pyx_mstate_global->__pyx_n_s_err_model_status
4979 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
4980 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
4981 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
4982 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
4983 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
4984 : #define __pyx_n_u_fun __pyx_mstate_global->__pyx_n_u_fun
4985 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
4986 : #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
4987 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
4988 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
4989 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
4990 : #define __pyx_n_s_highs __pyx_mstate_global->__pyx_n_s_highs
4991 : #define __pyx_n_u_highs_debug_level __pyx_mstate_global->__pyx_n_u_highs_debug_level
4992 : #define __pyx_n_s_highs_wrapper __pyx_mstate_global->__pyx_n_s_highs_wrapper
4993 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
4994 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
4995 : #define __pyx_n_s_ii __pyx_mstate_global->__pyx_n_s_ii
4996 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4997 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
4998 : #define __pyx_n_u_infinite_bound __pyx_mstate_global->__pyx_n_u_infinite_bound
4999 : #define __pyx_n_u_infinite_cost __pyx_mstate_global->__pyx_n_u_infinite_cost
5000 : #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info
5001 : #define __pyx_n_s_init_status __pyx_mstate_global->__pyx_n_s_init_status
5002 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
5003 : #define __pyx_n_s_integrality __pyx_mstate_global->__pyx_n_s_integrality
5004 : #define __pyx_n_s_integrality_ptr __pyx_mstate_global->__pyx_n_s_integrality_ptr
5005 : #define __pyx_n_u_ipm_iteration_limit __pyx_mstate_global->__pyx_n_u_ipm_iteration_limit
5006 : #define __pyx_n_u_ipm_nit __pyx_mstate_global->__pyx_n_u_ipm_nit
5007 : #define __pyx_n_u_ipm_optimality_tolerance __pyx_mstate_global->__pyx_n_u_ipm_optimality_tolerance
5008 : #define __pyx_kp_u_is __pyx_mstate_global->__pyx_kp_u_is
5009 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
5010 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
5011 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
5012 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
5013 : #define __pyx_n_u_keep_n_rows __pyx_mstate_global->__pyx_n_u_keep_n_rows
5014 : #define __pyx_n_u_lambda __pyx_mstate_global->__pyx_n_u_lambda
5015 : #define __pyx_n_u_large_matrix_value __pyx_mstate_global->__pyx_n_u_large_matrix_value
5016 : #define __pyx_n_s_lb __pyx_mstate_global->__pyx_n_s_lb
5017 : #define __pyx_n_u_less_infeasible_DSE_check __pyx_mstate_global->__pyx_n_u_less_infeasible_DSE_check
5018 : #define __pyx_n_u_less_infeasible_DSE_choose_row __pyx_mstate_global->__pyx_n_u_less_infeasible_DSE_choose_row
5019 : #define __pyx_n_s_lhs __pyx_mstate_global->__pyx_n_s_lhs
5020 : #define __pyx_n_u_log_to_console __pyx_mstate_global->__pyx_n_u_log_to_console
5021 : #define __pyx_n_s_lp __pyx_mstate_global->__pyx_n_s_lp
5022 : #define __pyx_n_s_lpFailCondition __pyx_mstate_global->__pyx_n_s_lpFailCondition
5023 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
5024 : #define __pyx_n_s_marg_bnds __pyx_mstate_global->__pyx_n_s_marg_bnds
5025 : #define __pyx_n_u_marg_bnds __pyx_mstate_global->__pyx_n_u_marg_bnds
5026 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
5027 : #define __pyx_n_u_message __pyx_mstate_global->__pyx_n_u_message
5028 : #define __pyx_n_s_mipFailCondition __pyx_mstate_global->__pyx_n_s_mipFailCondition
5029 : #define __pyx_n_u_mip_dual_bound __pyx_mstate_global->__pyx_n_u_mip_dual_bound
5030 : #define __pyx_n_u_mip_gap __pyx_mstate_global->__pyx_n_u_mip_gap
5031 : #define __pyx_n_u_mip_max_nodes __pyx_mstate_global->__pyx_n_u_mip_max_nodes
5032 : #define __pyx_n_u_mip_node_count __pyx_mstate_global->__pyx_n_u_mip_node_count
5033 : #define __pyx_n_u_mip_rel_gap __pyx_mstate_global->__pyx_n_u_mip_rel_gap
5034 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
5035 : #define __pyx_n_s_model_status __pyx_mstate_global->__pyx_n_s_model_status
5036 : #define __pyx_kp_u_model_status_is __pyx_mstate_global->__pyx_kp_u_model_status_is
5037 : #define __pyx_n_u_mps_parser_type_free __pyx_mstate_global->__pyx_n_u_mps_parser_type_free
5038 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
5039 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
5040 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
5041 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
5042 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
5043 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
5044 : #define __pyx_n_s_numbers __pyx_mstate_global->__pyx_n_s_numbers
5045 : #define __pyx_n_s_numcol __pyx_mstate_global->__pyx_n_s_numcol
5046 : #define __pyx_n_s_numintegrality __pyx_mstate_global->__pyx_n_s_numintegrality
5047 : #define __pyx_n_s_numnz __pyx_mstate_global->__pyx_n_s_numnz
5048 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
5049 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
5050 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
5051 : #define __pyx_n_s_numrow __pyx_mstate_global->__pyx_n_s_numrow
5052 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
5053 : #define __pyx_n_b_off __pyx_mstate_global->__pyx_n_b_off
5054 : #define __pyx_n_b_on __pyx_mstate_global->__pyx_n_b_on
5055 : #define __pyx_n_s_options __pyx_mstate_global->__pyx_n_s_options
5056 : #define __pyx_n_u_output_flag __pyx_mstate_global->__pyx_n_u_output_flag
5057 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
5058 : #define __pyx_n_u_parallel __pyx_mstate_global->__pyx_n_u_parallel
5059 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
5060 : #define __pyx_n_u_presolve __pyx_mstate_global->__pyx_n_u_presolve
5061 : #define __pyx_n_u_primal_feasibility_tolerance __pyx_mstate_global->__pyx_n_u_primal_feasibility_tolerance
5062 : #define __pyx_kp_u_primal_status_is __pyx_mstate_global->__pyx_kp_u_primal_status_is
5063 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
5064 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
5065 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
5066 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
5067 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
5068 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
5069 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
5070 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
5071 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
5072 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
5073 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
5074 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
5075 : #define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res
5076 : #define __pyx_n_s_rhs __pyx_mstate_global->__pyx_n_s_rhs
5077 : #define __pyx_n_s_rowlower_ptr __pyx_mstate_global->__pyx_n_s_rowlower_ptr
5078 : #define __pyx_n_s_rowupper_ptr __pyx_mstate_global->__pyx_n_s_rowupper_ptr
5079 : #define __pyx_n_u_run_as_hsol __pyx_mstate_global->__pyx_n_u_run_as_hsol
5080 : #define __pyx_n_u_run_crossover __pyx_mstate_global->__pyx_n_u_run_crossover
5081 : #define __pyx_n_s_run_status __pyx_mstate_global->__pyx_n_s_run_status
5082 : #define __pyx_n_s_scipy_optimize __pyx_mstate_global->__pyx_n_s_scipy_optimize
5083 : #define __pyx_n_s_scipy_optimize__highs_cython_src __pyx_mstate_global->__pyx_n_s_scipy_optimize__highs_cython_src
5084 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
5085 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
5086 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
5087 : #define __pyx_n_u_simplex_crash_strategy __pyx_mstate_global->__pyx_n_u_simplex_crash_strategy
5088 : #define __pyx_n_u_simplex_dual_edge_weight_strateg __pyx_mstate_global->__pyx_n_u_simplex_dual_edge_weight_strateg
5089 : #define __pyx_n_u_simplex_dualise_strategy __pyx_mstate_global->__pyx_n_u_simplex_dualise_strategy
5090 : #define __pyx_n_u_simplex_initial_condition_check __pyx_mstate_global->__pyx_n_u_simplex_initial_condition_check
5091 : #define __pyx_n_u_simplex_initial_condition_tolera __pyx_mstate_global->__pyx_n_u_simplex_initial_condition_tolera
5092 : #define __pyx_n_u_simplex_iteration_limit __pyx_mstate_global->__pyx_n_u_simplex_iteration_limit
5093 : #define __pyx_n_u_simplex_nit __pyx_mstate_global->__pyx_n_u_simplex_nit
5094 : #define __pyx_n_u_simplex_permute_strategy __pyx_mstate_global->__pyx_n_u_simplex_permute_strategy
5095 : #define __pyx_n_u_simplex_price_strategy __pyx_mstate_global->__pyx_n_u_simplex_price_strategy
5096 : #define __pyx_n_u_simplex_primal_edge_weight_strat __pyx_mstate_global->__pyx_n_u_simplex_primal_edge_weight_strat
5097 : #define __pyx_n_u_simplex_scale_strategy __pyx_mstate_global->__pyx_n_u_simplex_scale_strategy
5098 : #define __pyx_n_u_simplex_strategy __pyx_mstate_global->__pyx_n_u_simplex_strategy
5099 : #define __pyx_n_u_simplex_update_limit __pyx_mstate_global->__pyx_n_u_simplex_update_limit
5100 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
5101 : #define __pyx_n_u_slack __pyx_mstate_global->__pyx_n_u_slack
5102 : #define __pyx_n_u_small_matrix_value __pyx_mstate_global->__pyx_n_u_small_matrix_value
5103 : #define __pyx_n_s_solution __pyx_mstate_global->__pyx_n_s_solution
5104 : #define __pyx_n_u_solver __pyx_mstate_global->__pyx_n_u_solver
5105 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
5106 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
5107 : #define __pyx_n_u_start_crossover_tolerance __pyx_mstate_global->__pyx_n_u_start_crossover_tolerance
5108 : #define __pyx_n_u_status __pyx_mstate_global->__pyx_n_u_status
5109 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
5110 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
5111 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
5112 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
5113 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
5114 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
5115 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
5116 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
5117 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
5118 : #define __pyx_n_u_threads __pyx_mstate_global->__pyx_n_u_threads
5119 : #define __pyx_n_u_time_limit __pyx_mstate_global->__pyx_n_u_time_limit
5120 : #define __pyx_n_s_ub __pyx_mstate_global->__pyx_n_s_ub
5121 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
5122 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
5123 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
5124 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
5125 : #define __pyx_n_u_use_original_HFactor_logic __pyx_mstate_global->__pyx_n_u_use_original_HFactor_logic
5126 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
5127 : #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
5128 : #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
5129 : #define __pyx_n_u_x __pyx_mstate_global->__pyx_n_u_x
5130 : #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
5131 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
5132 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
5133 : #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
5134 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
5135 : #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10
5136 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
5137 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
5138 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
5139 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
5140 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
5141 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
5142 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
5143 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
5144 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
5145 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
5146 : #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
5147 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
5148 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
5149 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
5150 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
5151 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
5152 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
5153 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
5154 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
5155 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
5156 : #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25
5157 : #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
5158 : /* #### Code section: module_code ### */
5159 :
5160 : /* "string.to_py":31
5161 : *
5162 : * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
5163 : * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5164 : * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
5165 : * cdef extern from *:
5166 : */
5167 :
5168 : static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
5169 : PyObject *__pyx_r = NULL;
5170 : __Pyx_RefNannyDeclarations
5171 : PyObject *__pyx_t_1 = NULL;
5172 : int __pyx_lineno = 0;
5173 : const char *__pyx_filename = NULL;
5174 : int __pyx_clineno = 0;
5175 : __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
5176 :
5177 : /* "string.to_py":32
5178 : * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
5179 : * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
5180 : * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
5181 : * cdef extern from *:
5182 : * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
5183 : */
5184 : __Pyx_XDECREF(__pyx_r);
5185 : __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
5186 : __Pyx_GOTREF(__pyx_t_1);
5187 : __pyx_r = __pyx_t_1;
5188 : __pyx_t_1 = 0;
5189 : goto __pyx_L0;
5190 :
5191 : /* "string.to_py":31
5192 : *
5193 : * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
5194 : * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5195 : * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
5196 : * cdef extern from *:
5197 : */
5198 :
5199 : /* function exit code */
5200 : __pyx_L1_error:;
5201 : __Pyx_XDECREF(__pyx_t_1);
5202 : __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
5203 : __pyx_r = 0;
5204 : __pyx_L0:;
5205 : __Pyx_XGIVEREF(__pyx_r);
5206 : __Pyx_RefNannyFinishContext();
5207 : return __pyx_r;
5208 : }
5209 :
5210 : /* "string.to_py":37
5211 : *
5212 : * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
5213 : * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5214 : * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
5215 : * cdef extern from *:
5216 : */
5217 :
5218 : static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
5219 : PyObject *__pyx_r = NULL;
5220 : __Pyx_RefNannyDeclarations
5221 : PyObject *__pyx_t_1 = NULL;
5222 : int __pyx_lineno = 0;
5223 : const char *__pyx_filename = NULL;
5224 : int __pyx_clineno = 0;
5225 : __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
5226 :
5227 : /* "string.to_py":38
5228 : * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
5229 : * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
5230 : * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
5231 : * cdef extern from *:
5232 : * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
5233 : */
5234 : __Pyx_XDECREF(__pyx_r);
5235 : __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
5236 : __Pyx_GOTREF(__pyx_t_1);
5237 : __pyx_r = __pyx_t_1;
5238 : __pyx_t_1 = 0;
5239 : goto __pyx_L0;
5240 :
5241 : /* "string.to_py":37
5242 : *
5243 : * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
5244 : * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5245 : * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
5246 : * cdef extern from *:
5247 : */
5248 :
5249 : /* function exit code */
5250 : __pyx_L1_error:;
5251 : __Pyx_XDECREF(__pyx_t_1);
5252 : __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
5253 : __pyx_r = 0;
5254 : __pyx_L0:;
5255 : __Pyx_XGIVEREF(__pyx_r);
5256 : __Pyx_RefNannyFinishContext();
5257 : return __pyx_r;
5258 : }
5259 :
5260 : /* "string.to_py":43
5261 : *
5262 : * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
5263 : * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5264 : * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
5265 : * cdef extern from *:
5266 : */
5267 :
5268 : static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
5269 : PyObject *__pyx_r = NULL;
5270 : __Pyx_RefNannyDeclarations
5271 : PyObject *__pyx_t_1 = NULL;
5272 : int __pyx_lineno = 0;
5273 : const char *__pyx_filename = NULL;
5274 : int __pyx_clineno = 0;
5275 : __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
5276 :
5277 : /* "string.to_py":44
5278 : * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
5279 : * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s):
5280 : * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
5281 : * cdef extern from *:
5282 : * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
5283 : */
5284 : __Pyx_XDECREF(__pyx_r);
5285 : __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
5286 : __Pyx_GOTREF(__pyx_t_1);
5287 : __pyx_r = __pyx_t_1;
5288 : __pyx_t_1 = 0;
5289 : goto __pyx_L0;
5290 :
5291 : /* "string.to_py":43
5292 : *
5293 : * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
5294 : * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5295 : * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
5296 : * cdef extern from *:
5297 : */
5298 :
5299 : /* function exit code */
5300 : __pyx_L1_error:;
5301 : __Pyx_XDECREF(__pyx_t_1);
5302 : __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
5303 : __pyx_r = 0;
5304 : __pyx_L0:;
5305 : __Pyx_XGIVEREF(__pyx_r);
5306 : __Pyx_RefNannyFinishContext();
5307 : return __pyx_r;
5308 : }
5309 :
5310 : /* "string.to_py":49
5311 : *
5312 : * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
5313 : * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5314 : * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
5315 : * cdef extern from *:
5316 : */
5317 :
5318 : static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
5319 : PyObject *__pyx_r = NULL;
5320 : __Pyx_RefNannyDeclarations
5321 : PyObject *__pyx_t_1 = NULL;
5322 : int __pyx_lineno = 0;
5323 : const char *__pyx_filename = NULL;
5324 : int __pyx_clineno = 0;
5325 : __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
5326 :
5327 : /* "string.to_py":50
5328 : * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
5329 : * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
5330 : * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
5331 : * cdef extern from *:
5332 : * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
5333 : */
5334 : __Pyx_XDECREF(__pyx_r);
5335 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
5336 : __Pyx_GOTREF(__pyx_t_1);
5337 : __pyx_r = __pyx_t_1;
5338 : __pyx_t_1 = 0;
5339 : goto __pyx_L0;
5340 :
5341 : /* "string.to_py":49
5342 : *
5343 : * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
5344 : * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5345 : * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
5346 : * cdef extern from *:
5347 : */
5348 :
5349 : /* function exit code */
5350 : __pyx_L1_error:;
5351 : __Pyx_XDECREF(__pyx_t_1);
5352 : __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
5353 : __pyx_r = 0;
5354 : __pyx_L0:;
5355 : __Pyx_XGIVEREF(__pyx_r);
5356 : __Pyx_RefNannyFinishContext();
5357 : return __pyx_r;
5358 : }
5359 :
5360 : /* "string.to_py":55
5361 : *
5362 : * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
5363 : * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5364 : * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
5365 : *
5366 : */
5367 :
5368 : static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
5369 : PyObject *__pyx_r = NULL;
5370 : __Pyx_RefNannyDeclarations
5371 : PyObject *__pyx_t_1 = NULL;
5372 : int __pyx_lineno = 0;
5373 : const char *__pyx_filename = NULL;
5374 : int __pyx_clineno = 0;
5375 : __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
5376 :
5377 : /* "string.to_py":56
5378 : * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
5379 : * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
5380 : * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
5381 : *
5382 : */
5383 : __Pyx_XDECREF(__pyx_r);
5384 : __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
5385 : __Pyx_GOTREF(__pyx_t_1);
5386 : __pyx_r = __pyx_t_1;
5387 : __pyx_t_1 = 0;
5388 : goto __pyx_L0;
5389 :
5390 : /* "string.to_py":55
5391 : *
5392 : * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
5393 : * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
5394 : * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
5395 : *
5396 : */
5397 :
5398 : /* function exit code */
5399 : __pyx_L1_error:;
5400 : __Pyx_XDECREF(__pyx_t_1);
5401 : __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
5402 : __pyx_r = 0;
5403 : __pyx_L0:;
5404 : __Pyx_XGIVEREF(__pyx_r);
5405 : __Pyx_RefNannyFinishContext();
5406 : return __pyx_r;
5407 : }
5408 :
5409 : /* "string.from_py":13
5410 : *
5411 : * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
5412 : * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
5413 : * cdef Py_ssize_t length = 0
5414 : * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
5415 : */
5416 :
5417 6973 : static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
5418 6973 : Py_ssize_t __pyx_v_length;
5419 6973 : char const *__pyx_v_data;
5420 6973 : std::string __pyx_r;
5421 6973 : char const *__pyx_t_1;
5422 6973 : std::string __pyx_t_2;
5423 6973 : int __pyx_lineno = 0;
5424 6973 : const char *__pyx_filename = NULL;
5425 6973 : int __pyx_clineno = 0;
5426 :
5427 : /* "string.from_py":14
5428 : * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
5429 : * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
5430 : * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
5431 : * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
5432 : * return string(data, length)
5433 : */
5434 6973 : __pyx_v_length = 0;
5435 :
5436 : /* "string.from_py":15
5437 : * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
5438 : * cdef Py_ssize_t length = 0
5439 : * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
5440 : * return string(data, length)
5441 : *
5442 : */
5443 6973 : __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error)
5444 6973 : __pyx_v_data = __pyx_t_1;
5445 :
5446 : /* "string.from_py":16
5447 : * cdef Py_ssize_t length = 0
5448 : * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
5449 : * return string(data, length) # <<<<<<<<<<<<<<
5450 : *
5451 : *
5452 : */
5453 6973 : try {
5454 6973 : __pyx_t_2 = std::string(__pyx_v_data, __pyx_v_length);
5455 0 : } catch(...) {
5456 0 : __Pyx_CppExn2PyErr();
5457 0 : __PYX_ERR(1, 16, __pyx_L1_error)
5458 0 : }
5459 6973 : __pyx_r = __pyx_t_2;
5460 6973 : goto __pyx_L0;
5461 :
5462 : /* "string.from_py":13
5463 : *
5464 : * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
5465 : * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
5466 : * cdef Py_ssize_t length = 0
5467 : * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
5468 : */
5469 :
5470 : /* function exit code */
5471 0 : __pyx_L1_error:;
5472 0 : __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
5473 : __Pyx_pretend_to_initialize(&__pyx_r);
5474 6973 : __pyx_L0:;
5475 6973 : return __pyx_r;
5476 6973 : }
5477 :
5478 : /* "View.MemoryView":131
5479 : * cdef bint dtype_is_object
5480 : *
5481 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5482 : * mode="c", bint allocate_buffer=True):
5483 : *
5484 : */
5485 :
5486 : /* Python wrapper */
5487 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5488 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5489 0 : PyObject *__pyx_v_shape = 0;
5490 0 : Py_ssize_t __pyx_v_itemsize;
5491 0 : PyObject *__pyx_v_format = 0;
5492 0 : PyObject *__pyx_v_mode = 0;
5493 0 : int __pyx_v_allocate_buffer;
5494 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5495 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5496 0 : PyObject* values[5] = {0,0,0,0,0};
5497 0 : int __pyx_lineno = 0;
5498 0 : const char *__pyx_filename = NULL;
5499 0 : int __pyx_clineno = 0;
5500 0 : int __pyx_r;
5501 : __Pyx_RefNannyDeclarations
5502 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
5503 : #if CYTHON_ASSUME_SAFE_MACROS
5504 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5505 : #else
5506 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
5507 : #endif
5508 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5509 0 : {
5510 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
5511 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
5512 0 : if (__pyx_kwds) {
5513 0 : Py_ssize_t kw_args;
5514 0 : switch (__pyx_nargs) {
5515 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
5516 0 : CYTHON_FALLTHROUGH;
5517 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
5518 0 : CYTHON_FALLTHROUGH;
5519 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
5520 0 : CYTHON_FALLTHROUGH;
5521 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
5522 0 : CYTHON_FALLTHROUGH;
5523 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
5524 0 : CYTHON_FALLTHROUGH;
5525 0 : case 0: break;
5526 0 : default: goto __pyx_L5_argtuple_error;
5527 : }
5528 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
5529 0 : switch (__pyx_nargs) {
5530 0 : case 0:
5531 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
5532 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
5533 0 : kw_args--;
5534 : }
5535 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5536 0 : else goto __pyx_L5_argtuple_error;
5537 0 : CYTHON_FALLTHROUGH;
5538 0 : case 1:
5539 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
5540 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
5541 0 : kw_args--;
5542 : }
5543 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5544 : else {
5545 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
5546 : }
5547 0 : CYTHON_FALLTHROUGH;
5548 0 : case 2:
5549 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
5550 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
5551 0 : kw_args--;
5552 : }
5553 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5554 : else {
5555 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
5556 : }
5557 0 : CYTHON_FALLTHROUGH;
5558 0 : case 3:
5559 0 : if (kw_args > 0) {
5560 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
5561 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5562 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5563 : }
5564 0 : CYTHON_FALLTHROUGH;
5565 0 : case 4:
5566 0 : if (kw_args > 0) {
5567 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
5568 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5569 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5570 : }
5571 : }
5572 0 : if (unlikely(kw_args > 0)) {
5573 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
5574 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
5575 : }
5576 : } else {
5577 0 : switch (__pyx_nargs) {
5578 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
5579 0 : CYTHON_FALLTHROUGH;
5580 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
5581 0 : CYTHON_FALLTHROUGH;
5582 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
5583 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
5584 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
5585 0 : break;
5586 0 : default: goto __pyx_L5_argtuple_error;
5587 : }
5588 : }
5589 0 : __pyx_v_shape = ((PyObject*)values[0]);
5590 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5591 0 : __pyx_v_format = values[2];
5592 0 : __pyx_v_mode = values[3];
5593 0 : if (values[4]) {
5594 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
5595 : } else {
5596 :
5597 : /* "View.MemoryView":132
5598 : *
5599 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5600 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5601 : *
5602 : * cdef int idx
5603 : */
5604 : __pyx_v_allocate_buffer = ((int)1);
5605 : }
5606 : }
5607 0 : goto __pyx_L6_skip;
5608 0 : __pyx_L5_argtuple_error:;
5609 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
5610 0 : __pyx_L6_skip:;
5611 0 : goto __pyx_L4_argument_unpacking_done;
5612 0 : __pyx_L3_error:;
5613 0 : {
5614 0 : Py_ssize_t __pyx_temp;
5615 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5616 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5617 : }
5618 : }
5619 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5620 : __Pyx_RefNannyFinishContext();
5621 : return -1;
5622 0 : __pyx_L4_argument_unpacking_done:;
5623 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
5624 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5625 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
5626 : }
5627 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
5628 :
5629 : /* "View.MemoryView":131
5630 : * cdef bint dtype_is_object
5631 : *
5632 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5633 : * mode="c", bint allocate_buffer=True):
5634 : *
5635 : */
5636 :
5637 : /* function exit code */
5638 0 : goto __pyx_L0;
5639 : __pyx_L1_error:;
5640 : __pyx_r = -1;
5641 0 : __pyx_L0:;
5642 0 : {
5643 0 : Py_ssize_t __pyx_temp;
5644 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5645 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5646 : }
5647 : }
5648 : __Pyx_RefNannyFinishContext();
5649 : return __pyx_r;
5650 : }
5651 :
5652 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
5653 0 : int __pyx_v_idx;
5654 0 : Py_ssize_t __pyx_v_dim;
5655 0 : char __pyx_v_order;
5656 0 : int __pyx_r;
5657 : __Pyx_RefNannyDeclarations
5658 0 : Py_ssize_t __pyx_t_1;
5659 0 : int __pyx_t_2;
5660 0 : int __pyx_t_3;
5661 0 : PyObject *__pyx_t_4 = NULL;
5662 0 : PyObject *__pyx_t_5 = NULL;
5663 0 : PyObject *__pyx_t_6 = NULL;
5664 0 : unsigned int __pyx_t_7;
5665 0 : char *__pyx_t_8;
5666 0 : int __pyx_t_9;
5667 0 : Py_ssize_t __pyx_t_10;
5668 0 : Py_UCS4 __pyx_t_11;
5669 0 : int __pyx_lineno = 0;
5670 0 : const char *__pyx_filename = NULL;
5671 0 : int __pyx_clineno = 0;
5672 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
5673 0 : __Pyx_INCREF(__pyx_v_format);
5674 :
5675 : /* "View.MemoryView":137
5676 : * cdef Py_ssize_t dim
5677 : *
5678 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5679 : * self.itemsize = itemsize
5680 : *
5681 : */
5682 0 : if (unlikely(__pyx_v_shape == Py_None)) {
5683 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5684 0 : __PYX_ERR(1, 137, __pyx_L1_error)
5685 : }
5686 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
5687 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
5688 :
5689 : /* "View.MemoryView":138
5690 : *
5691 : * self.ndim = <int> len(shape)
5692 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
5693 : *
5694 : * if not self.ndim:
5695 : */
5696 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
5697 :
5698 : /* "View.MemoryView":140
5699 : * self.itemsize = itemsize
5700 : *
5701 : * if not self.ndim: # <<<<<<<<<<<<<<
5702 : * raise ValueError, "Empty shape tuple for cython.array"
5703 : *
5704 : */
5705 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
5706 0 : if (unlikely(__pyx_t_2)) {
5707 :
5708 : /* "View.MemoryView":141
5709 : *
5710 : * if not self.ndim:
5711 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
5712 : *
5713 : * if itemsize <= 0:
5714 : */
5715 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
5716 0 : __PYX_ERR(1, 141, __pyx_L1_error)
5717 :
5718 : /* "View.MemoryView":140
5719 : * self.itemsize = itemsize
5720 : *
5721 : * if not self.ndim: # <<<<<<<<<<<<<<
5722 : * raise ValueError, "Empty shape tuple for cython.array"
5723 : *
5724 : */
5725 : }
5726 :
5727 : /* "View.MemoryView":143
5728 : * raise ValueError, "Empty shape tuple for cython.array"
5729 : *
5730 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5731 : * raise ValueError, "itemsize <= 0 for cython.array"
5732 : *
5733 : */
5734 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
5735 0 : if (unlikely(__pyx_t_2)) {
5736 :
5737 : /* "View.MemoryView":144
5738 : *
5739 : * if itemsize <= 0:
5740 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
5741 : *
5742 : * if not isinstance(format, bytes):
5743 : */
5744 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
5745 0 : __PYX_ERR(1, 144, __pyx_L1_error)
5746 :
5747 : /* "View.MemoryView":143
5748 : * raise ValueError, "Empty shape tuple for cython.array"
5749 : *
5750 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5751 : * raise ValueError, "itemsize <= 0 for cython.array"
5752 : *
5753 : */
5754 : }
5755 :
5756 : /* "View.MemoryView":146
5757 : * raise ValueError, "itemsize <= 0 for cython.array"
5758 : *
5759 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5760 : * format = format.encode('ASCII')
5761 : * self._format = format # keep a reference to the byte string
5762 : */
5763 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5764 0 : __pyx_t_3 = (!__pyx_t_2);
5765 0 : if (__pyx_t_3) {
5766 :
5767 : /* "View.MemoryView":147
5768 : *
5769 : * if not isinstance(format, bytes):
5770 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5771 : * self._format = format # keep a reference to the byte string
5772 : * self.format = self._format
5773 : */
5774 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
5775 0 : __Pyx_GOTREF(__pyx_t_5);
5776 0 : __pyx_t_6 = NULL;
5777 0 : __pyx_t_7 = 0;
5778 : #if CYTHON_UNPACK_METHODS
5779 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
5780 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5781 0 : if (likely(__pyx_t_6)) {
5782 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5783 0 : __Pyx_INCREF(__pyx_t_6);
5784 0 : __Pyx_INCREF(function);
5785 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
5786 : __pyx_t_7 = 1;
5787 : }
5788 : }
5789 : #endif
5790 0 : {
5791 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
5792 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
5793 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5794 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
5795 0 : __Pyx_GOTREF(__pyx_t_4);
5796 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5797 : }
5798 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
5799 : __pyx_t_4 = 0;
5800 :
5801 : /* "View.MemoryView":146
5802 : * raise ValueError, "itemsize <= 0 for cython.array"
5803 : *
5804 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5805 : * format = format.encode('ASCII')
5806 : * self._format = format # keep a reference to the byte string
5807 : */
5808 : }
5809 :
5810 : /* "View.MemoryView":148
5811 : * if not isinstance(format, bytes):
5812 : * format = format.encode('ASCII')
5813 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5814 : * self.format = self._format
5815 : *
5816 : */
5817 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
5818 0 : __pyx_t_4 = __pyx_v_format;
5819 0 : __Pyx_INCREF(__pyx_t_4);
5820 0 : __Pyx_GIVEREF(__pyx_t_4);
5821 0 : __Pyx_GOTREF(__pyx_v_self->_format);
5822 0 : __Pyx_DECREF(__pyx_v_self->_format);
5823 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
5824 0 : __pyx_t_4 = 0;
5825 :
5826 : /* "View.MemoryView":149
5827 : * format = format.encode('ASCII')
5828 : * self._format = format # keep a reference to the byte string
5829 : * self.format = self._format # <<<<<<<<<<<<<<
5830 : *
5831 : *
5832 : */
5833 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
5834 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5835 0 : __PYX_ERR(1, 149, __pyx_L1_error)
5836 : }
5837 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
5838 0 : __pyx_v_self->format = __pyx_t_8;
5839 :
5840 : /* "View.MemoryView":152
5841 : *
5842 : *
5843 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
5844 : * self._strides = self._shape + self.ndim
5845 : *
5846 : */
5847 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
5848 :
5849 : /* "View.MemoryView":153
5850 : *
5851 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
5852 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5853 : *
5854 : * if not self._shape:
5855 : */
5856 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5857 :
5858 : /* "View.MemoryView":155
5859 : * self._strides = self._shape + self.ndim
5860 : *
5861 : * if not self._shape: # <<<<<<<<<<<<<<
5862 : * raise MemoryError, "unable to allocate shape and strides."
5863 : *
5864 : */
5865 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
5866 0 : if (unlikely(__pyx_t_3)) {
5867 :
5868 : /* "View.MemoryView":156
5869 : *
5870 : * if not self._shape:
5871 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5872 : *
5873 : *
5874 : */
5875 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
5876 0 : __PYX_ERR(1, 156, __pyx_L1_error)
5877 :
5878 : /* "View.MemoryView":155
5879 : * self._strides = self._shape + self.ndim
5880 : *
5881 : * if not self._shape: # <<<<<<<<<<<<<<
5882 : * raise MemoryError, "unable to allocate shape and strides."
5883 : *
5884 : */
5885 : }
5886 :
5887 : /* "View.MemoryView":159
5888 : *
5889 : *
5890 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5891 : * if dim <= 0:
5892 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5893 : */
5894 0 : __pyx_t_9 = 0;
5895 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
5896 : __pyx_t_1 = 0;
5897 0 : for (;;) {
5898 0 : {
5899 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
5900 : #if !CYTHON_ASSUME_SAFE_MACROS
5901 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5902 : #endif
5903 0 : if (__pyx_t_1 >= __pyx_temp) break;
5904 : }
5905 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5906 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5907 : #else
5908 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
5909 : __Pyx_GOTREF(__pyx_t_5);
5910 : #endif
5911 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
5912 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5913 0 : __pyx_v_dim = __pyx_t_10;
5914 0 : __pyx_v_idx = __pyx_t_9;
5915 0 : __pyx_t_9 = (__pyx_t_9 + 1);
5916 :
5917 : /* "View.MemoryView":160
5918 : *
5919 : * for idx, dim in enumerate(shape):
5920 : * if dim <= 0: # <<<<<<<<<<<<<<
5921 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5922 : * self._shape[idx] = dim
5923 : */
5924 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
5925 0 : if (unlikely(__pyx_t_3)) {
5926 :
5927 : /* "View.MemoryView":161
5928 : * for idx, dim in enumerate(shape):
5929 : * if dim <= 0:
5930 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5931 : * self._shape[idx] = dim
5932 : *
5933 : */
5934 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
5935 0 : __Pyx_GOTREF(__pyx_t_5);
5936 0 : __pyx_t_10 = 0;
5937 0 : __pyx_t_11 = 127;
5938 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
5939 0 : __pyx_t_10 += 22;
5940 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
5941 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
5942 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5943 0 : __Pyx_GOTREF(__pyx_t_6);
5944 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5945 0 : __Pyx_GIVEREF(__pyx_t_6);
5946 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5947 0 : __pyx_t_6 = 0;
5948 0 : __Pyx_INCREF(__pyx_kp_u_);
5949 0 : __pyx_t_10 += 2;
5950 0 : __Pyx_GIVEREF(__pyx_kp_u_);
5951 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
5952 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5953 0 : __Pyx_GOTREF(__pyx_t_6);
5954 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5955 0 : __Pyx_GIVEREF(__pyx_t_6);
5956 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
5957 0 : __pyx_t_6 = 0;
5958 0 : __Pyx_INCREF(__pyx_kp_u__2);
5959 0 : __pyx_t_10 += 1;
5960 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
5961 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
5962 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5963 0 : __Pyx_GOTREF(__pyx_t_6);
5964 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5965 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5966 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5967 0 : __PYX_ERR(1, 161, __pyx_L1_error)
5968 :
5969 : /* "View.MemoryView":160
5970 : *
5971 : * for idx, dim in enumerate(shape):
5972 : * if dim <= 0: # <<<<<<<<<<<<<<
5973 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5974 : * self._shape[idx] = dim
5975 : */
5976 : }
5977 :
5978 : /* "View.MemoryView":162
5979 : * if dim <= 0:
5980 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5981 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
5982 : *
5983 : * cdef char order
5984 : */
5985 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5986 :
5987 : /* "View.MemoryView":159
5988 : *
5989 : *
5990 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5991 : * if dim <= 0:
5992 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5993 : */
5994 0 : }
5995 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5996 :
5997 : /* "View.MemoryView":165
5998 : *
5999 : * cdef char order
6000 : * if mode == 'c': # <<<<<<<<<<<<<<
6001 : * order = b'C'
6002 : * self.mode = u'c'
6003 : */
6004 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
6005 0 : if (__pyx_t_3) {
6006 :
6007 : /* "View.MemoryView":166
6008 : * cdef char order
6009 : * if mode == 'c':
6010 : * order = b'C' # <<<<<<<<<<<<<<
6011 : * self.mode = u'c'
6012 : * elif mode == 'fortran':
6013 : */
6014 0 : __pyx_v_order = 'C';
6015 :
6016 : /* "View.MemoryView":167
6017 : * if mode == 'c':
6018 : * order = b'C'
6019 : * self.mode = u'c' # <<<<<<<<<<<<<<
6020 : * elif mode == 'fortran':
6021 : * order = b'F'
6022 : */
6023 0 : __Pyx_INCREF(__pyx_n_u_c);
6024 0 : __Pyx_GIVEREF(__pyx_n_u_c);
6025 0 : __Pyx_GOTREF(__pyx_v_self->mode);
6026 0 : __Pyx_DECREF(__pyx_v_self->mode);
6027 0 : __pyx_v_self->mode = __pyx_n_u_c;
6028 :
6029 : /* "View.MemoryView":165
6030 : *
6031 : * cdef char order
6032 : * if mode == 'c': # <<<<<<<<<<<<<<
6033 : * order = b'C'
6034 : * self.mode = u'c'
6035 : */
6036 0 : goto __pyx_L11;
6037 : }
6038 :
6039 : /* "View.MemoryView":168
6040 : * order = b'C'
6041 : * self.mode = u'c'
6042 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
6043 : * order = b'F'
6044 : * self.mode = u'fortran'
6045 : */
6046 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
6047 0 : if (likely(__pyx_t_3)) {
6048 :
6049 : /* "View.MemoryView":169
6050 : * self.mode = u'c'
6051 : * elif mode == 'fortran':
6052 : * order = b'F' # <<<<<<<<<<<<<<
6053 : * self.mode = u'fortran'
6054 : * else:
6055 : */
6056 0 : __pyx_v_order = 'F';
6057 :
6058 : /* "View.MemoryView":170
6059 : * elif mode == 'fortran':
6060 : * order = b'F'
6061 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
6062 : * else:
6063 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
6064 : */
6065 0 : __Pyx_INCREF(__pyx_n_u_fortran);
6066 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
6067 0 : __Pyx_GOTREF(__pyx_v_self->mode);
6068 0 : __Pyx_DECREF(__pyx_v_self->mode);
6069 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
6070 :
6071 : /* "View.MemoryView":168
6072 : * order = b'C'
6073 : * self.mode = u'c'
6074 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
6075 : * order = b'F'
6076 : * self.mode = u'fortran'
6077 : */
6078 0 : goto __pyx_L11;
6079 : }
6080 :
6081 : /* "View.MemoryView":172
6082 : * self.mode = u'fortran'
6083 : * else:
6084 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
6085 : *
6086 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
6087 : */
6088 0 : /*else*/ {
6089 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
6090 0 : __Pyx_GOTREF(__pyx_t_4);
6091 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
6092 0 : __Pyx_GOTREF(__pyx_t_6);
6093 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6094 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
6095 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6096 0 : __PYX_ERR(1, 172, __pyx_L1_error)
6097 : }
6098 0 : __pyx_L11:;
6099 :
6100 : /* "View.MemoryView":174
6101 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
6102 : *
6103 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
6104 : *
6105 : * self.free_data = allocate_buffer
6106 : */
6107 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6108 :
6109 : /* "View.MemoryView":176
6110 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
6111 : *
6112 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
6113 : * self.dtype_is_object = format == b'O'
6114 : *
6115 : */
6116 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6117 :
6118 : /* "View.MemoryView":177
6119 : *
6120 : * self.free_data = allocate_buffer
6121 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
6122 : *
6123 : * if allocate_buffer:
6124 : */
6125 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
6126 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
6127 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6128 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
6129 :
6130 : /* "View.MemoryView":179
6131 : * self.dtype_is_object = format == b'O'
6132 : *
6133 : * if allocate_buffer: # <<<<<<<<<<<<<<
6134 : * _allocate_buffer(self)
6135 : *
6136 : */
6137 0 : if (__pyx_v_allocate_buffer) {
6138 :
6139 : /* "View.MemoryView":180
6140 : *
6141 : * if allocate_buffer:
6142 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
6143 : *
6144 : * @cname('getbuffer')
6145 : */
6146 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
6147 :
6148 : /* "View.MemoryView":179
6149 : * self.dtype_is_object = format == b'O'
6150 : *
6151 : * if allocate_buffer: # <<<<<<<<<<<<<<
6152 : * _allocate_buffer(self)
6153 : *
6154 : */
6155 : }
6156 :
6157 : /* "View.MemoryView":131
6158 : * cdef bint dtype_is_object
6159 : *
6160 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6161 : * mode="c", bint allocate_buffer=True):
6162 : *
6163 : */
6164 :
6165 : /* function exit code */
6166 0 : __pyx_r = 0;
6167 0 : goto __pyx_L0;
6168 0 : __pyx_L1_error:;
6169 0 : __Pyx_XDECREF(__pyx_t_4);
6170 0 : __Pyx_XDECREF(__pyx_t_5);
6171 0 : __Pyx_XDECREF(__pyx_t_6);
6172 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6173 0 : __pyx_r = -1;
6174 0 : __pyx_L0:;
6175 0 : __Pyx_XDECREF(__pyx_v_format);
6176 0 : __Pyx_RefNannyFinishContext();
6177 0 : return __pyx_r;
6178 : }
6179 :
6180 : /* "View.MemoryView":182
6181 : * _allocate_buffer(self)
6182 : *
6183 : * @cname('getbuffer') # <<<<<<<<<<<<<<
6184 : * def __getbuffer__(self, Py_buffer *info, int flags):
6185 : * cdef int bufmode = -1
6186 : */
6187 :
6188 : /* Python wrapper */
6189 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6190 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6191 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6192 0 : int __pyx_r;
6193 : __Pyx_RefNannyDeclarations
6194 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6195 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6196 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6197 :
6198 : /* function exit code */
6199 0 : __Pyx_RefNannyFinishContext();
6200 0 : return __pyx_r;
6201 : }
6202 :
6203 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6204 0 : int __pyx_v_bufmode;
6205 0 : int __pyx_r;
6206 : __Pyx_RefNannyDeclarations
6207 0 : int __pyx_t_1;
6208 0 : char *__pyx_t_2;
6209 0 : Py_ssize_t __pyx_t_3;
6210 0 : int __pyx_t_4;
6211 0 : Py_ssize_t *__pyx_t_5;
6212 0 : int __pyx_lineno = 0;
6213 0 : const char *__pyx_filename = NULL;
6214 0 : int __pyx_clineno = 0;
6215 0 : if (unlikely(__pyx_v_info == NULL)) {
6216 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6217 0 : return -1;
6218 : }
6219 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
6220 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6221 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
6222 :
6223 : /* "View.MemoryView":184
6224 : * @cname('getbuffer')
6225 : * def __getbuffer__(self, Py_buffer *info, int flags):
6226 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
6227 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6228 : * if self.mode == u"c":
6229 : */
6230 0 : __pyx_v_bufmode = -1;
6231 :
6232 : /* "View.MemoryView":185
6233 : * def __getbuffer__(self, Py_buffer *info, int flags):
6234 : * cdef int bufmode = -1
6235 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
6236 : * if self.mode == u"c":
6237 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6238 : */
6239 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
6240 0 : if (__pyx_t_1) {
6241 :
6242 : /* "View.MemoryView":186
6243 : * cdef int bufmode = -1
6244 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6245 : * if self.mode == u"c": # <<<<<<<<<<<<<<
6246 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6247 : * elif self.mode == u"fortran":
6248 : */
6249 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
6250 0 : if (__pyx_t_1) {
6251 :
6252 : /* "View.MemoryView":187
6253 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6254 : * if self.mode == u"c":
6255 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6256 : * elif self.mode == u"fortran":
6257 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6258 : */
6259 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6260 :
6261 : /* "View.MemoryView":186
6262 : * cdef int bufmode = -1
6263 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6264 : * if self.mode == u"c": # <<<<<<<<<<<<<<
6265 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6266 : * elif self.mode == u"fortran":
6267 : */
6268 0 : goto __pyx_L4;
6269 : }
6270 :
6271 : /* "View.MemoryView":188
6272 : * if self.mode == u"c":
6273 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6274 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6275 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6276 : * if not (flags & bufmode):
6277 : */
6278 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
6279 0 : if (__pyx_t_1) {
6280 :
6281 : /* "View.MemoryView":189
6282 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6283 : * elif self.mode == u"fortran":
6284 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6285 : * if not (flags & bufmode):
6286 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6287 : */
6288 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6289 :
6290 : /* "View.MemoryView":188
6291 : * if self.mode == u"c":
6292 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6293 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6294 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6295 : * if not (flags & bufmode):
6296 : */
6297 : }
6298 0 : __pyx_L4:;
6299 :
6300 : /* "View.MemoryView":190
6301 : * elif self.mode == u"fortran":
6302 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6303 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
6304 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6305 : * info.buf = self.data
6306 : */
6307 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
6308 0 : if (unlikely(__pyx_t_1)) {
6309 :
6310 : /* "View.MemoryView":191
6311 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6312 : * if not (flags & bufmode):
6313 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
6314 : * info.buf = self.data
6315 : * info.len = self.len
6316 : */
6317 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
6318 0 : __PYX_ERR(1, 191, __pyx_L1_error)
6319 :
6320 : /* "View.MemoryView":190
6321 : * elif self.mode == u"fortran":
6322 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6323 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
6324 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6325 : * info.buf = self.data
6326 : */
6327 : }
6328 :
6329 : /* "View.MemoryView":185
6330 : * def __getbuffer__(self, Py_buffer *info, int flags):
6331 : * cdef int bufmode = -1
6332 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
6333 : * if self.mode == u"c":
6334 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6335 : */
6336 : }
6337 :
6338 : /* "View.MemoryView":192
6339 : * if not (flags & bufmode):
6340 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6341 : * info.buf = self.data # <<<<<<<<<<<<<<
6342 : * info.len = self.len
6343 : *
6344 : */
6345 0 : __pyx_t_2 = __pyx_v_self->data;
6346 0 : __pyx_v_info->buf = __pyx_t_2;
6347 :
6348 : /* "View.MemoryView":193
6349 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6350 : * info.buf = self.data
6351 : * info.len = self.len # <<<<<<<<<<<<<<
6352 : *
6353 : * if flags & PyBUF_STRIDES:
6354 : */
6355 0 : __pyx_t_3 = __pyx_v_self->len;
6356 0 : __pyx_v_info->len = __pyx_t_3;
6357 :
6358 : /* "View.MemoryView":195
6359 : * info.len = self.len
6360 : *
6361 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
6362 : * info.ndim = self.ndim
6363 : * info.shape = self._shape
6364 : */
6365 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
6366 0 : if (__pyx_t_1) {
6367 :
6368 : /* "View.MemoryView":196
6369 : *
6370 : * if flags & PyBUF_STRIDES:
6371 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
6372 : * info.shape = self._shape
6373 : * info.strides = self._strides
6374 : */
6375 0 : __pyx_t_4 = __pyx_v_self->ndim;
6376 0 : __pyx_v_info->ndim = __pyx_t_4;
6377 :
6378 : /* "View.MemoryView":197
6379 : * if flags & PyBUF_STRIDES:
6380 : * info.ndim = self.ndim
6381 : * info.shape = self._shape # <<<<<<<<<<<<<<
6382 : * info.strides = self._strides
6383 : * else:
6384 : */
6385 0 : __pyx_t_5 = __pyx_v_self->_shape;
6386 0 : __pyx_v_info->shape = __pyx_t_5;
6387 :
6388 : /* "View.MemoryView":198
6389 : * info.ndim = self.ndim
6390 : * info.shape = self._shape
6391 : * info.strides = self._strides # <<<<<<<<<<<<<<
6392 : * else:
6393 : * info.ndim = 1
6394 : */
6395 0 : __pyx_t_5 = __pyx_v_self->_strides;
6396 0 : __pyx_v_info->strides = __pyx_t_5;
6397 :
6398 : /* "View.MemoryView":195
6399 : * info.len = self.len
6400 : *
6401 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
6402 : * info.ndim = self.ndim
6403 : * info.shape = self._shape
6404 : */
6405 0 : goto __pyx_L6;
6406 : }
6407 :
6408 : /* "View.MemoryView":200
6409 : * info.strides = self._strides
6410 : * else:
6411 : * info.ndim = 1 # <<<<<<<<<<<<<<
6412 : * info.shape = &self.len if flags & PyBUF_ND else NULL
6413 : * info.strides = NULL
6414 : */
6415 0 : /*else*/ {
6416 0 : __pyx_v_info->ndim = 1;
6417 :
6418 : /* "View.MemoryView":201
6419 : * else:
6420 : * info.ndim = 1
6421 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
6422 : * info.strides = NULL
6423 : *
6424 : */
6425 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
6426 0 : if (__pyx_t_1) {
6427 : __pyx_t_5 = (&__pyx_v_self->len);
6428 : } else {
6429 : __pyx_t_5 = NULL;
6430 : }
6431 0 : __pyx_v_info->shape = __pyx_t_5;
6432 :
6433 : /* "View.MemoryView":202
6434 : * info.ndim = 1
6435 : * info.shape = &self.len if flags & PyBUF_ND else NULL
6436 : * info.strides = NULL # <<<<<<<<<<<<<<
6437 : *
6438 : * info.suboffsets = NULL
6439 : */
6440 0 : __pyx_v_info->strides = NULL;
6441 : }
6442 0 : __pyx_L6:;
6443 :
6444 : /* "View.MemoryView":204
6445 : * info.strides = NULL
6446 : *
6447 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
6448 : * info.itemsize = self.itemsize
6449 : * info.readonly = 0
6450 : */
6451 0 : __pyx_v_info->suboffsets = NULL;
6452 :
6453 : /* "View.MemoryView":205
6454 : *
6455 : * info.suboffsets = NULL
6456 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
6457 : * info.readonly = 0
6458 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
6459 : */
6460 0 : __pyx_t_3 = __pyx_v_self->itemsize;
6461 0 : __pyx_v_info->itemsize = __pyx_t_3;
6462 :
6463 : /* "View.MemoryView":206
6464 : * info.suboffsets = NULL
6465 : * info.itemsize = self.itemsize
6466 : * info.readonly = 0 # <<<<<<<<<<<<<<
6467 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
6468 : * info.obj = self
6469 : */
6470 0 : __pyx_v_info->readonly = 0;
6471 :
6472 : /* "View.MemoryView":207
6473 : * info.itemsize = self.itemsize
6474 : * info.readonly = 0
6475 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
6476 : * info.obj = self
6477 : *
6478 : */
6479 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
6480 0 : if (__pyx_t_1) {
6481 0 : __pyx_t_2 = __pyx_v_self->format;
6482 : } else {
6483 : __pyx_t_2 = NULL;
6484 : }
6485 0 : __pyx_v_info->format = __pyx_t_2;
6486 :
6487 : /* "View.MemoryView":208
6488 : * info.readonly = 0
6489 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
6490 : * info.obj = self # <<<<<<<<<<<<<<
6491 : *
6492 : * def __dealloc__(array self):
6493 : */
6494 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6495 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6496 0 : __Pyx_GOTREF(__pyx_v_info->obj);
6497 0 : __Pyx_DECREF(__pyx_v_info->obj);
6498 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6499 :
6500 : /* "View.MemoryView":182
6501 : * _allocate_buffer(self)
6502 : *
6503 : * @cname('getbuffer') # <<<<<<<<<<<<<<
6504 : * def __getbuffer__(self, Py_buffer *info, int flags):
6505 : * cdef int bufmode = -1
6506 : */
6507 :
6508 : /* function exit code */
6509 0 : __pyx_r = 0;
6510 0 : goto __pyx_L0;
6511 0 : __pyx_L1_error:;
6512 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6513 0 : __pyx_r = -1;
6514 0 : if (__pyx_v_info->obj != NULL) {
6515 0 : __Pyx_GOTREF(__pyx_v_info->obj);
6516 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6517 : }
6518 0 : goto __pyx_L2;
6519 0 : __pyx_L0:;
6520 0 : if (__pyx_v_info->obj == Py_None) {
6521 0 : __Pyx_GOTREF(__pyx_v_info->obj);
6522 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6523 : }
6524 0 : __pyx_L2:;
6525 : __Pyx_RefNannyFinishContext();
6526 : return __pyx_r;
6527 : }
6528 :
6529 : /* "View.MemoryView":210
6530 : * info.obj = self
6531 : *
6532 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
6533 : * if self.callback_free_data != NULL:
6534 : * self.callback_free_data(self.data)
6535 : */
6536 :
6537 : /* Python wrapper */
6538 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
6539 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
6540 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6541 : __Pyx_RefNannyDeclarations
6542 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
6543 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6544 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
6545 :
6546 : /* function exit code */
6547 0 : __Pyx_RefNannyFinishContext();
6548 : }
6549 :
6550 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
6551 0 : int __pyx_t_1;
6552 0 : int __pyx_t_2;
6553 :
6554 : /* "View.MemoryView":211
6555 : *
6556 : * def __dealloc__(array self):
6557 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6558 : * self.callback_free_data(self.data)
6559 : * elif self.free_data and self.data is not NULL:
6560 : */
6561 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
6562 0 : if (__pyx_t_1) {
6563 :
6564 : /* "View.MemoryView":212
6565 : * def __dealloc__(array self):
6566 : * if self.callback_free_data != NULL:
6567 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
6568 : * elif self.free_data and self.data is not NULL:
6569 : * if self.dtype_is_object:
6570 : */
6571 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
6572 :
6573 : /* "View.MemoryView":211
6574 : *
6575 : * def __dealloc__(array self):
6576 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6577 : * self.callback_free_data(self.data)
6578 : * elif self.free_data and self.data is not NULL:
6579 : */
6580 0 : goto __pyx_L3;
6581 : }
6582 :
6583 : /* "View.MemoryView":213
6584 : * if self.callback_free_data != NULL:
6585 : * self.callback_free_data(self.data)
6586 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6587 : * if self.dtype_is_object:
6588 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6589 : */
6590 0 : if (__pyx_v_self->free_data) {
6591 : } else {
6592 0 : __pyx_t_1 = __pyx_v_self->free_data;
6593 0 : goto __pyx_L4_bool_binop_done;
6594 : }
6595 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
6596 0 : __pyx_t_1 = __pyx_t_2;
6597 0 : __pyx_L4_bool_binop_done:;
6598 0 : if (__pyx_t_1) {
6599 :
6600 : /* "View.MemoryView":214
6601 : * self.callback_free_data(self.data)
6602 : * elif self.free_data and self.data is not NULL:
6603 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6604 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6605 : * free(self.data)
6606 : */
6607 0 : if (__pyx_v_self->dtype_is_object) {
6608 :
6609 : /* "View.MemoryView":215
6610 : * elif self.free_data and self.data is not NULL:
6611 : * if self.dtype_is_object:
6612 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
6613 : * free(self.data)
6614 : * PyObject_Free(self._shape)
6615 : */
6616 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6617 :
6618 : /* "View.MemoryView":214
6619 : * self.callback_free_data(self.data)
6620 : * elif self.free_data and self.data is not NULL:
6621 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6622 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6623 : * free(self.data)
6624 : */
6625 : }
6626 :
6627 : /* "View.MemoryView":216
6628 : * if self.dtype_is_object:
6629 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6630 : * free(self.data) # <<<<<<<<<<<<<<
6631 : * PyObject_Free(self._shape)
6632 : *
6633 : */
6634 0 : free(__pyx_v_self->data);
6635 :
6636 : /* "View.MemoryView":213
6637 : * if self.callback_free_data != NULL:
6638 : * self.callback_free_data(self.data)
6639 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6640 : * if self.dtype_is_object:
6641 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6642 : */
6643 : }
6644 0 : __pyx_L3:;
6645 :
6646 : /* "View.MemoryView":217
6647 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6648 : * free(self.data)
6649 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6650 : *
6651 : * @property
6652 : */
6653 0 : PyObject_Free(__pyx_v_self->_shape);
6654 :
6655 : /* "View.MemoryView":210
6656 : * info.obj = self
6657 : *
6658 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
6659 : * if self.callback_free_data != NULL:
6660 : * self.callback_free_data(self.data)
6661 : */
6662 :
6663 : /* function exit code */
6664 0 : }
6665 :
6666 : /* "View.MemoryView":219
6667 : * PyObject_Free(self._shape)
6668 : *
6669 : * @property # <<<<<<<<<<<<<<
6670 : * def memview(self):
6671 : * return self.get_memview()
6672 : */
6673 :
6674 : /* Python wrapper */
6675 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
6676 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6677 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6678 0 : PyObject *__pyx_r = 0;
6679 : __Pyx_RefNannyDeclarations
6680 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6681 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6682 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
6683 :
6684 : /* function exit code */
6685 0 : __Pyx_RefNannyFinishContext();
6686 0 : return __pyx_r;
6687 : }
6688 :
6689 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
6690 0 : PyObject *__pyx_r = NULL;
6691 : __Pyx_RefNannyDeclarations
6692 0 : PyObject *__pyx_t_1 = NULL;
6693 0 : int __pyx_lineno = 0;
6694 0 : const char *__pyx_filename = NULL;
6695 0 : int __pyx_clineno = 0;
6696 0 : __Pyx_RefNannySetupContext("__get__", 1);
6697 :
6698 : /* "View.MemoryView":221
6699 : * @property
6700 : * def memview(self):
6701 : * return self.get_memview() # <<<<<<<<<<<<<<
6702 : *
6703 : * @cname('get_memview')
6704 : */
6705 0 : __Pyx_XDECREF(__pyx_r);
6706 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
6707 0 : __Pyx_GOTREF(__pyx_t_1);
6708 0 : __pyx_r = __pyx_t_1;
6709 0 : __pyx_t_1 = 0;
6710 0 : goto __pyx_L0;
6711 :
6712 : /* "View.MemoryView":219
6713 : * PyObject_Free(self._shape)
6714 : *
6715 : * @property # <<<<<<<<<<<<<<
6716 : * def memview(self):
6717 : * return self.get_memview()
6718 : */
6719 :
6720 : /* function exit code */
6721 0 : __pyx_L1_error:;
6722 0 : __Pyx_XDECREF(__pyx_t_1);
6723 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6724 0 : __pyx_r = NULL;
6725 0 : __pyx_L0:;
6726 0 : __Pyx_XGIVEREF(__pyx_r);
6727 0 : __Pyx_RefNannyFinishContext();
6728 0 : return __pyx_r;
6729 : }
6730 :
6731 : /* "View.MemoryView":224
6732 : *
6733 : * @cname('get_memview')
6734 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6735 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6736 : * return memoryview(self, flags, self.dtype_is_object)
6737 : */
6738 :
6739 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
6740 0 : int __pyx_v_flags;
6741 0 : PyObject *__pyx_r = NULL;
6742 : __Pyx_RefNannyDeclarations
6743 0 : PyObject *__pyx_t_1 = NULL;
6744 0 : PyObject *__pyx_t_2 = NULL;
6745 0 : PyObject *__pyx_t_3 = NULL;
6746 0 : int __pyx_lineno = 0;
6747 0 : const char *__pyx_filename = NULL;
6748 0 : int __pyx_clineno = 0;
6749 0 : __Pyx_RefNannySetupContext("get_memview", 1);
6750 :
6751 : /* "View.MemoryView":225
6752 : * @cname('get_memview')
6753 : * cdef get_memview(self):
6754 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6755 : * return memoryview(self, flags, self.dtype_is_object)
6756 : *
6757 : */
6758 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6759 :
6760 : /* "View.MemoryView":226
6761 : * cdef get_memview(self):
6762 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6763 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6764 : *
6765 : * def __len__(self):
6766 : */
6767 0 : __Pyx_XDECREF(__pyx_r);
6768 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
6769 0 : __Pyx_GOTREF(__pyx_t_1);
6770 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6771 0 : __Pyx_GOTREF(__pyx_t_2);
6772 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
6773 0 : __Pyx_GOTREF(__pyx_t_3);
6774 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6775 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6776 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
6777 0 : __Pyx_GIVEREF(__pyx_t_1);
6778 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
6779 0 : __Pyx_GIVEREF(__pyx_t_2);
6780 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
6781 0 : __pyx_t_1 = 0;
6782 0 : __pyx_t_2 = 0;
6783 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6784 0 : __Pyx_GOTREF(__pyx_t_2);
6785 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6786 0 : __pyx_r = __pyx_t_2;
6787 0 : __pyx_t_2 = 0;
6788 0 : goto __pyx_L0;
6789 :
6790 : /* "View.MemoryView":224
6791 : *
6792 : * @cname('get_memview')
6793 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6794 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6795 : * return memoryview(self, flags, self.dtype_is_object)
6796 : */
6797 :
6798 : /* function exit code */
6799 0 : __pyx_L1_error:;
6800 0 : __Pyx_XDECREF(__pyx_t_1);
6801 0 : __Pyx_XDECREF(__pyx_t_2);
6802 0 : __Pyx_XDECREF(__pyx_t_3);
6803 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6804 0 : __pyx_r = 0;
6805 0 : __pyx_L0:;
6806 0 : __Pyx_XGIVEREF(__pyx_r);
6807 0 : __Pyx_RefNannyFinishContext();
6808 0 : return __pyx_r;
6809 : }
6810 :
6811 : /* "View.MemoryView":228
6812 : * return memoryview(self, flags, self.dtype_is_object)
6813 : *
6814 : * def __len__(self): # <<<<<<<<<<<<<<
6815 : * return self._shape[0]
6816 : *
6817 : */
6818 :
6819 : /* Python wrapper */
6820 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6821 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6822 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6823 0 : Py_ssize_t __pyx_r;
6824 : __Pyx_RefNannyDeclarations
6825 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6826 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6827 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6828 :
6829 : /* function exit code */
6830 0 : __Pyx_RefNannyFinishContext();
6831 0 : return __pyx_r;
6832 : }
6833 :
6834 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6835 0 : Py_ssize_t __pyx_r;
6836 :
6837 : /* "View.MemoryView":229
6838 : *
6839 : * def __len__(self):
6840 : * return self._shape[0] # <<<<<<<<<<<<<<
6841 : *
6842 : * def __getattr__(self, attr):
6843 : */
6844 0 : __pyx_r = (__pyx_v_self->_shape[0]);
6845 0 : goto __pyx_L0;
6846 :
6847 : /* "View.MemoryView":228
6848 : * return memoryview(self, flags, self.dtype_is_object)
6849 : *
6850 : * def __len__(self): # <<<<<<<<<<<<<<
6851 : * return self._shape[0]
6852 : *
6853 : */
6854 :
6855 : /* function exit code */
6856 0 : __pyx_L0:;
6857 0 : return __pyx_r;
6858 : }
6859 :
6860 : /* "View.MemoryView":231
6861 : * return self._shape[0]
6862 : *
6863 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6864 : * return getattr(self.memview, attr)
6865 : *
6866 : */
6867 :
6868 : /* Python wrapper */
6869 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6870 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6871 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6872 0 : PyObject *__pyx_r = 0;
6873 : __Pyx_RefNannyDeclarations
6874 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6875 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6876 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6877 :
6878 : /* function exit code */
6879 0 : __Pyx_RefNannyFinishContext();
6880 0 : return __pyx_r;
6881 : }
6882 :
6883 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6884 0 : PyObject *__pyx_r = NULL;
6885 : __Pyx_RefNannyDeclarations
6886 0 : PyObject *__pyx_t_1 = NULL;
6887 0 : PyObject *__pyx_t_2 = NULL;
6888 0 : int __pyx_lineno = 0;
6889 0 : const char *__pyx_filename = NULL;
6890 0 : int __pyx_clineno = 0;
6891 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
6892 :
6893 : /* "View.MemoryView":232
6894 : *
6895 : * def __getattr__(self, attr):
6896 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6897 : *
6898 : * def __getitem__(self, item):
6899 : */
6900 0 : __Pyx_XDECREF(__pyx_r);
6901 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
6902 0 : __Pyx_GOTREF(__pyx_t_1);
6903 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
6904 0 : __Pyx_GOTREF(__pyx_t_2);
6905 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6906 0 : __pyx_r = __pyx_t_2;
6907 0 : __pyx_t_2 = 0;
6908 0 : goto __pyx_L0;
6909 :
6910 : /* "View.MemoryView":231
6911 : * return self._shape[0]
6912 : *
6913 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6914 : * return getattr(self.memview, attr)
6915 : *
6916 : */
6917 :
6918 : /* function exit code */
6919 0 : __pyx_L1_error:;
6920 0 : __Pyx_XDECREF(__pyx_t_1);
6921 0 : __Pyx_XDECREF(__pyx_t_2);
6922 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6923 0 : __pyx_r = NULL;
6924 0 : __pyx_L0:;
6925 0 : __Pyx_XGIVEREF(__pyx_r);
6926 0 : __Pyx_RefNannyFinishContext();
6927 0 : return __pyx_r;
6928 : }
6929 :
6930 : /* "View.MemoryView":234
6931 : * return getattr(self.memview, attr)
6932 : *
6933 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6934 : * return self.memview[item]
6935 : *
6936 : */
6937 :
6938 : /* Python wrapper */
6939 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6940 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6941 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6942 0 : PyObject *__pyx_r = 0;
6943 : __Pyx_RefNannyDeclarations
6944 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6945 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6946 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6947 :
6948 : /* function exit code */
6949 0 : __Pyx_RefNannyFinishContext();
6950 0 : return __pyx_r;
6951 : }
6952 :
6953 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6954 0 : PyObject *__pyx_r = NULL;
6955 : __Pyx_RefNannyDeclarations
6956 0 : PyObject *__pyx_t_1 = NULL;
6957 0 : PyObject *__pyx_t_2 = NULL;
6958 0 : int __pyx_lineno = 0;
6959 0 : const char *__pyx_filename = NULL;
6960 0 : int __pyx_clineno = 0;
6961 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
6962 :
6963 : /* "View.MemoryView":235
6964 : *
6965 : * def __getitem__(self, item):
6966 : * return self.memview[item] # <<<<<<<<<<<<<<
6967 : *
6968 : * def __setitem__(self, item, value):
6969 : */
6970 0 : __Pyx_XDECREF(__pyx_r);
6971 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
6972 0 : __Pyx_GOTREF(__pyx_t_1);
6973 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
6974 0 : __Pyx_GOTREF(__pyx_t_2);
6975 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6976 0 : __pyx_r = __pyx_t_2;
6977 0 : __pyx_t_2 = 0;
6978 0 : goto __pyx_L0;
6979 :
6980 : /* "View.MemoryView":234
6981 : * return getattr(self.memview, attr)
6982 : *
6983 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6984 : * return self.memview[item]
6985 : *
6986 : */
6987 :
6988 : /* function exit code */
6989 0 : __pyx_L1_error:;
6990 0 : __Pyx_XDECREF(__pyx_t_1);
6991 0 : __Pyx_XDECREF(__pyx_t_2);
6992 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6993 0 : __pyx_r = NULL;
6994 0 : __pyx_L0:;
6995 0 : __Pyx_XGIVEREF(__pyx_r);
6996 0 : __Pyx_RefNannyFinishContext();
6997 0 : return __pyx_r;
6998 : }
6999 :
7000 : /* "View.MemoryView":237
7001 : * return self.memview[item]
7002 : *
7003 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7004 : * self.memview[item] = value
7005 : *
7006 : */
7007 :
7008 : /* Python wrapper */
7009 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
7010 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7011 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7012 0 : int __pyx_r;
7013 : __Pyx_RefNannyDeclarations
7014 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7015 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7016 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7017 :
7018 : /* function exit code */
7019 0 : __Pyx_RefNannyFinishContext();
7020 0 : return __pyx_r;
7021 : }
7022 :
7023 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7024 0 : int __pyx_r;
7025 : __Pyx_RefNannyDeclarations
7026 0 : PyObject *__pyx_t_1 = NULL;
7027 0 : int __pyx_lineno = 0;
7028 0 : const char *__pyx_filename = NULL;
7029 0 : int __pyx_clineno = 0;
7030 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
7031 :
7032 : /* "View.MemoryView":238
7033 : *
7034 : * def __setitem__(self, item, value):
7035 : * self.memview[item] = value # <<<<<<<<<<<<<<
7036 : *
7037 : *
7038 : */
7039 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
7040 0 : __Pyx_GOTREF(__pyx_t_1);
7041 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
7042 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7043 :
7044 : /* "View.MemoryView":237
7045 : * return self.memview[item]
7046 : *
7047 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7048 : * self.memview[item] = value
7049 : *
7050 : */
7051 :
7052 : /* function exit code */
7053 0 : __pyx_r = 0;
7054 0 : goto __pyx_L0;
7055 0 : __pyx_L1_error:;
7056 0 : __Pyx_XDECREF(__pyx_t_1);
7057 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7058 0 : __pyx_r = -1;
7059 0 : __pyx_L0:;
7060 0 : __Pyx_RefNannyFinishContext();
7061 0 : return __pyx_r;
7062 : }
7063 :
7064 : /* "(tree fragment)":1
7065 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7066 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7067 : * def __setstate_cython__(self, __pyx_state):
7068 : */
7069 :
7070 : /* Python wrapper */
7071 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
7072 : #if CYTHON_METH_FASTCALL
7073 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7074 : #else
7075 : PyObject *__pyx_args, PyObject *__pyx_kwds
7076 : #endif
7077 : ); /*proto*/
7078 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
7079 : #if CYTHON_METH_FASTCALL
7080 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7081 : #else
7082 : PyObject *__pyx_args, PyObject *__pyx_kwds
7083 : #endif
7084 : ) {
7085 : #if !CYTHON_METH_FASTCALL
7086 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7087 : #endif
7088 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7089 0 : PyObject *__pyx_r = 0;
7090 : __Pyx_RefNannyDeclarations
7091 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7092 : #if !CYTHON_METH_FASTCALL
7093 : #if CYTHON_ASSUME_SAFE_MACROS
7094 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7095 : #else
7096 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7097 : #endif
7098 : #endif
7099 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7100 0 : if (unlikely(__pyx_nargs > 0)) {
7101 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7102 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7103 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7104 :
7105 : /* function exit code */
7106 0 : __Pyx_RefNannyFinishContext();
7107 0 : return __pyx_r;
7108 : }
7109 :
7110 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7111 0 : PyObject *__pyx_r = NULL;
7112 : __Pyx_RefNannyDeclarations
7113 0 : int __pyx_lineno = 0;
7114 0 : const char *__pyx_filename = NULL;
7115 0 : int __pyx_clineno = 0;
7116 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7117 :
7118 : /* "(tree fragment)":2
7119 : * def __reduce_cython__(self):
7120 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
7121 : * def __setstate_cython__(self, __pyx_state):
7122 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7123 : */
7124 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
7125 0 : __PYX_ERR(1, 2, __pyx_L1_error)
7126 :
7127 : /* "(tree fragment)":1
7128 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7129 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7130 : * def __setstate_cython__(self, __pyx_state):
7131 : */
7132 :
7133 : /* function exit code */
7134 0 : __pyx_L1_error:;
7135 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7136 0 : __pyx_r = NULL;
7137 0 : __Pyx_XGIVEREF(__pyx_r);
7138 0 : __Pyx_RefNannyFinishContext();
7139 0 : return __pyx_r;
7140 : }
7141 :
7142 : /* "(tree fragment)":3
7143 : * def __reduce_cython__(self):
7144 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7145 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7146 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7147 : */
7148 :
7149 : /* Python wrapper */
7150 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
7151 : #if CYTHON_METH_FASTCALL
7152 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7153 : #else
7154 : PyObject *__pyx_args, PyObject *__pyx_kwds
7155 : #endif
7156 : ); /*proto*/
7157 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
7158 : #if CYTHON_METH_FASTCALL
7159 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7160 : #else
7161 : PyObject *__pyx_args, PyObject *__pyx_kwds
7162 : #endif
7163 : ) {
7164 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
7165 : #if !CYTHON_METH_FASTCALL
7166 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7167 : #endif
7168 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7169 0 : PyObject* values[1] = {0};
7170 0 : int __pyx_lineno = 0;
7171 0 : const char *__pyx_filename = NULL;
7172 0 : int __pyx_clineno = 0;
7173 0 : PyObject *__pyx_r = 0;
7174 : __Pyx_RefNannyDeclarations
7175 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7176 : #if !CYTHON_METH_FASTCALL
7177 : #if CYTHON_ASSUME_SAFE_MACROS
7178 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7179 : #else
7180 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7181 : #endif
7182 : #endif
7183 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7184 0 : {
7185 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7186 0 : if (__pyx_kwds) {
7187 0 : Py_ssize_t kw_args;
7188 0 : switch (__pyx_nargs) {
7189 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7190 0 : CYTHON_FALLTHROUGH;
7191 0 : case 0: break;
7192 0 : default: goto __pyx_L5_argtuple_error;
7193 : }
7194 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7195 0 : switch (__pyx_nargs) {
7196 0 : case 0:
7197 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7198 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7199 0 : kw_args--;
7200 : }
7201 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
7202 0 : else goto __pyx_L5_argtuple_error;
7203 : }
7204 0 : if (unlikely(kw_args > 0)) {
7205 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7206 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
7207 : }
7208 0 : } else if (unlikely(__pyx_nargs != 1)) {
7209 0 : goto __pyx_L5_argtuple_error;
7210 : } else {
7211 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7212 : }
7213 0 : __pyx_v___pyx_state = values[0];
7214 : }
7215 0 : goto __pyx_L6_skip;
7216 0 : __pyx_L5_argtuple_error:;
7217 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
7218 0 : __pyx_L6_skip:;
7219 0 : goto __pyx_L4_argument_unpacking_done;
7220 0 : __pyx_L3_error:;
7221 0 : {
7222 0 : Py_ssize_t __pyx_temp;
7223 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7224 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7225 : }
7226 : }
7227 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7228 : __Pyx_RefNannyFinishContext();
7229 : return NULL;
7230 0 : __pyx_L4_argument_unpacking_done:;
7231 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
7232 :
7233 : /* function exit code */
7234 : {
7235 : Py_ssize_t __pyx_temp;
7236 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7237 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7238 : }
7239 : }
7240 : __Pyx_RefNannyFinishContext();
7241 : return __pyx_r;
7242 : }
7243 :
7244 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7245 0 : PyObject *__pyx_r = NULL;
7246 : __Pyx_RefNannyDeclarations
7247 0 : int __pyx_lineno = 0;
7248 0 : const char *__pyx_filename = NULL;
7249 0 : int __pyx_clineno = 0;
7250 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7251 :
7252 : /* "(tree fragment)":4
7253 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7254 : * def __setstate_cython__(self, __pyx_state):
7255 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
7256 : */
7257 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
7258 0 : __PYX_ERR(1, 4, __pyx_L1_error)
7259 :
7260 : /* "(tree fragment)":3
7261 : * def __reduce_cython__(self):
7262 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7263 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7264 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7265 : */
7266 :
7267 : /* function exit code */
7268 0 : __pyx_L1_error:;
7269 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7270 0 : __pyx_r = NULL;
7271 0 : __Pyx_XGIVEREF(__pyx_r);
7272 0 : __Pyx_RefNannyFinishContext();
7273 0 : return __pyx_r;
7274 : }
7275 :
7276 : /* "View.MemoryView":248
7277 : *
7278 : * @cname("__pyx_array_allocate_buffer")
7279 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
7280 : *
7281 : *
7282 : */
7283 :
7284 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
7285 0 : Py_ssize_t __pyx_v_i;
7286 0 : PyObject **__pyx_v_p;
7287 0 : int __pyx_r;
7288 0 : int __pyx_t_1;
7289 0 : Py_ssize_t __pyx_t_2;
7290 0 : Py_ssize_t __pyx_t_3;
7291 0 : Py_ssize_t __pyx_t_4;
7292 0 : int __pyx_lineno = 0;
7293 0 : const char *__pyx_filename = NULL;
7294 0 : int __pyx_clineno = 0;
7295 :
7296 : /* "View.MemoryView":254
7297 : * cdef PyObject **p
7298 : *
7299 : * self.free_data = True # <<<<<<<<<<<<<<
7300 : * self.data = <char *>malloc(self.len)
7301 : * if not self.data:
7302 : */
7303 0 : __pyx_v_self->free_data = 1;
7304 :
7305 : /* "View.MemoryView":255
7306 : *
7307 : * self.free_data = True
7308 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7309 : * if not self.data:
7310 : * raise MemoryError, "unable to allocate array data."
7311 : */
7312 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7313 :
7314 : /* "View.MemoryView":256
7315 : * self.free_data = True
7316 : * self.data = <char *>malloc(self.len)
7317 : * if not self.data: # <<<<<<<<<<<<<<
7318 : * raise MemoryError, "unable to allocate array data."
7319 : *
7320 : */
7321 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
7322 0 : if (unlikely(__pyx_t_1)) {
7323 :
7324 : /* "View.MemoryView":257
7325 : * self.data = <char *>malloc(self.len)
7326 : * if not self.data:
7327 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
7328 : *
7329 : * if self.dtype_is_object:
7330 : */
7331 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
7332 0 : __PYX_ERR(1, 257, __pyx_L1_error)
7333 :
7334 : /* "View.MemoryView":256
7335 : * self.free_data = True
7336 : * self.data = <char *>malloc(self.len)
7337 : * if not self.data: # <<<<<<<<<<<<<<
7338 : * raise MemoryError, "unable to allocate array data."
7339 : *
7340 : */
7341 : }
7342 :
7343 : /* "View.MemoryView":259
7344 : * raise MemoryError, "unable to allocate array data."
7345 : *
7346 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
7347 : * p = <PyObject **> self.data
7348 : * for i in range(self.len // self.itemsize):
7349 : */
7350 0 : if (__pyx_v_self->dtype_is_object) {
7351 :
7352 : /* "View.MemoryView":260
7353 : *
7354 : * if self.dtype_is_object:
7355 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7356 : * for i in range(self.len // self.itemsize):
7357 : * p[i] = Py_None
7358 : */
7359 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7360 :
7361 : /* "View.MemoryView":261
7362 : * if self.dtype_is_object:
7363 : * p = <PyObject **> self.data
7364 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
7365 : * p[i] = Py_None
7366 : * Py_INCREF(Py_None)
7367 : */
7368 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
7369 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7370 0 : __PYX_ERR(1, 261, __pyx_L1_error)
7371 : }
7372 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7373 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
7374 0 : __PYX_ERR(1, 261, __pyx_L1_error)
7375 : }
7376 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
7377 0 : __pyx_t_3 = __pyx_t_2;
7378 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7379 0 : __pyx_v_i = __pyx_t_4;
7380 :
7381 : /* "View.MemoryView":262
7382 : * p = <PyObject **> self.data
7383 : * for i in range(self.len // self.itemsize):
7384 : * p[i] = Py_None # <<<<<<<<<<<<<<
7385 : * Py_INCREF(Py_None)
7386 : * return 0
7387 : */
7388 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
7389 :
7390 : /* "View.MemoryView":263
7391 : * for i in range(self.len // self.itemsize):
7392 : * p[i] = Py_None
7393 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7394 : * return 0
7395 : *
7396 : */
7397 0 : Py_INCREF(Py_None);
7398 : }
7399 :
7400 : /* "View.MemoryView":259
7401 : * raise MemoryError, "unable to allocate array data."
7402 : *
7403 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
7404 : * p = <PyObject **> self.data
7405 : * for i in range(self.len // self.itemsize):
7406 : */
7407 : }
7408 :
7409 : /* "View.MemoryView":264
7410 : * p[i] = Py_None
7411 : * Py_INCREF(Py_None)
7412 : * return 0 # <<<<<<<<<<<<<<
7413 : *
7414 : *
7415 : */
7416 0 : __pyx_r = 0;
7417 0 : goto __pyx_L0;
7418 :
7419 : /* "View.MemoryView":248
7420 : *
7421 : * @cname("__pyx_array_allocate_buffer")
7422 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
7423 : *
7424 : *
7425 : */
7426 :
7427 : /* function exit code */
7428 0 : __pyx_L1_error:;
7429 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
7430 0 : __pyx_r = -1;
7431 0 : __pyx_L0:;
7432 0 : return __pyx_r;
7433 : }
7434 :
7435 : /* "View.MemoryView":268
7436 : *
7437 : * @cname("__pyx_array_new")
7438 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
7439 : * cdef array result
7440 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7441 : */
7442 :
7443 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
7444 0 : struct __pyx_array_obj *__pyx_v_result = 0;
7445 0 : PyObject *__pyx_v_mode = 0;
7446 0 : struct __pyx_array_obj *__pyx_r = NULL;
7447 : __Pyx_RefNannyDeclarations
7448 0 : PyObject *__pyx_t_1 = NULL;
7449 0 : int __pyx_t_2;
7450 0 : PyObject *__pyx_t_3 = NULL;
7451 0 : PyObject *__pyx_t_4 = NULL;
7452 0 : int __pyx_lineno = 0;
7453 0 : const char *__pyx_filename = NULL;
7454 0 : int __pyx_clineno = 0;
7455 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
7456 :
7457 : /* "View.MemoryView":270
7458 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
7459 : * cdef array result
7460 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
7461 : *
7462 : * if buf is NULL:
7463 : */
7464 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
7465 0 : if (__pyx_t_2) {
7466 0 : __Pyx_INCREF(__pyx_n_s_fortran);
7467 : __pyx_t_1 = __pyx_n_s_fortran;
7468 : } else {
7469 0 : __Pyx_INCREF(__pyx_n_s_c);
7470 : __pyx_t_1 = __pyx_n_s_c;
7471 : }
7472 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
7473 0 : __pyx_t_1 = 0;
7474 :
7475 : /* "View.MemoryView":272
7476 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7477 : *
7478 : * if buf is NULL: # <<<<<<<<<<<<<<
7479 : * result = array.__new__(array, shape, itemsize, format, mode)
7480 : * else:
7481 : */
7482 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
7483 0 : if (__pyx_t_2) {
7484 :
7485 : /* "View.MemoryView":273
7486 : *
7487 : * if buf is NULL:
7488 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
7489 : * else:
7490 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7491 : */
7492 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
7493 0 : __Pyx_GOTREF(__pyx_t_1);
7494 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
7495 0 : __Pyx_GOTREF(__pyx_t_3);
7496 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
7497 0 : __Pyx_GOTREF(__pyx_t_4);
7498 0 : __Pyx_INCREF(__pyx_v_shape);
7499 0 : __Pyx_GIVEREF(__pyx_v_shape);
7500 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
7501 0 : __Pyx_GIVEREF(__pyx_t_1);
7502 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
7503 0 : __Pyx_GIVEREF(__pyx_t_3);
7504 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
7505 0 : __Pyx_INCREF(__pyx_v_mode);
7506 0 : __Pyx_GIVEREF(__pyx_v_mode);
7507 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
7508 0 : __pyx_t_1 = 0;
7509 0 : __pyx_t_3 = 0;
7510 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
7511 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
7512 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7513 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7514 0 : __pyx_t_3 = 0;
7515 :
7516 : /* "View.MemoryView":272
7517 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7518 : *
7519 : * if buf is NULL: # <<<<<<<<<<<<<<
7520 : * result = array.__new__(array, shape, itemsize, format, mode)
7521 : * else:
7522 : */
7523 0 : goto __pyx_L3;
7524 : }
7525 :
7526 : /* "View.MemoryView":275
7527 : * result = array.__new__(array, shape, itemsize, format, mode)
7528 : * else:
7529 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
7530 : * result.data = buf
7531 : *
7532 : */
7533 0 : /*else*/ {
7534 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
7535 0 : __Pyx_GOTREF(__pyx_t_3);
7536 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
7537 0 : __Pyx_GOTREF(__pyx_t_4);
7538 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
7539 0 : __Pyx_GOTREF(__pyx_t_1);
7540 0 : __Pyx_INCREF(__pyx_v_shape);
7541 0 : __Pyx_GIVEREF(__pyx_v_shape);
7542 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
7543 0 : __Pyx_GIVEREF(__pyx_t_3);
7544 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
7545 0 : __Pyx_GIVEREF(__pyx_t_4);
7546 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
7547 0 : __Pyx_INCREF(__pyx_v_mode);
7548 0 : __Pyx_GIVEREF(__pyx_v_mode);
7549 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
7550 0 : __pyx_t_3 = 0;
7551 0 : __pyx_t_4 = 0;
7552 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
7553 0 : __Pyx_GOTREF(__pyx_t_4);
7554 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
7555 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
7556 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
7557 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7558 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7559 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7560 0 : __pyx_t_3 = 0;
7561 :
7562 : /* "View.MemoryView":276
7563 : * else:
7564 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7565 : * result.data = buf # <<<<<<<<<<<<<<
7566 : *
7567 : * return result
7568 : */
7569 0 : __pyx_v_result->data = __pyx_v_buf;
7570 : }
7571 0 : __pyx_L3:;
7572 :
7573 : /* "View.MemoryView":278
7574 : * result.data = buf
7575 : *
7576 : * return result # <<<<<<<<<<<<<<
7577 : *
7578 : *
7579 : */
7580 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
7581 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
7582 0 : __pyx_r = __pyx_v_result;
7583 0 : goto __pyx_L0;
7584 :
7585 : /* "View.MemoryView":268
7586 : *
7587 : * @cname("__pyx_array_new")
7588 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
7589 : * cdef array result
7590 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7591 : */
7592 :
7593 : /* function exit code */
7594 0 : __pyx_L1_error:;
7595 0 : __Pyx_XDECREF(__pyx_t_1);
7596 0 : __Pyx_XDECREF(__pyx_t_3);
7597 0 : __Pyx_XDECREF(__pyx_t_4);
7598 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7599 0 : __pyx_r = 0;
7600 0 : __pyx_L0:;
7601 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
7602 0 : __Pyx_XDECREF(__pyx_v_mode);
7603 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
7604 0 : __Pyx_RefNannyFinishContext();
7605 0 : return __pyx_r;
7606 : }
7607 :
7608 : /* "View.MemoryView":304
7609 : * cdef class Enum(object):
7610 : * cdef object name
7611 : * def __init__(self, name): # <<<<<<<<<<<<<<
7612 : * self.name = name
7613 : * def __repr__(self):
7614 : */
7615 :
7616 : /* Python wrapper */
7617 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7618 5 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7619 5 : PyObject *__pyx_v_name = 0;
7620 5 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7621 5 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7622 5 : PyObject* values[1] = {0};
7623 5 : int __pyx_lineno = 0;
7624 5 : const char *__pyx_filename = NULL;
7625 5 : int __pyx_clineno = 0;
7626 5 : int __pyx_r;
7627 : __Pyx_RefNannyDeclarations
7628 5 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7629 : #if CYTHON_ASSUME_SAFE_MACROS
7630 5 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7631 : #else
7632 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7633 : #endif
7634 5 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7635 5 : {
7636 5 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7637 5 : if (__pyx_kwds) {
7638 0 : Py_ssize_t kw_args;
7639 0 : switch (__pyx_nargs) {
7640 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7641 0 : CYTHON_FALLTHROUGH;
7642 0 : case 0: break;
7643 0 : default: goto __pyx_L5_argtuple_error;
7644 : }
7645 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7646 0 : switch (__pyx_nargs) {
7647 0 : case 0:
7648 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
7649 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7650 0 : kw_args--;
7651 : }
7652 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
7653 0 : else goto __pyx_L5_argtuple_error;
7654 : }
7655 0 : if (unlikely(kw_args > 0)) {
7656 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7657 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
7658 : }
7659 5 : } else if (unlikely(__pyx_nargs != 1)) {
7660 0 : goto __pyx_L5_argtuple_error;
7661 : } else {
7662 5 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7663 : }
7664 5 : __pyx_v_name = values[0];
7665 : }
7666 5 : goto __pyx_L6_skip;
7667 0 : __pyx_L5_argtuple_error:;
7668 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
7669 5 : __pyx_L6_skip:;
7670 5 : goto __pyx_L4_argument_unpacking_done;
7671 0 : __pyx_L3_error:;
7672 0 : {
7673 0 : Py_ssize_t __pyx_temp;
7674 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7675 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7676 : }
7677 : }
7678 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7679 : __Pyx_RefNannyFinishContext();
7680 : return -1;
7681 5 : __pyx_L4_argument_unpacking_done:;
7682 5 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7683 :
7684 : /* function exit code */
7685 : {
7686 : Py_ssize_t __pyx_temp;
7687 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7688 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7689 : }
7690 : }
7691 : __Pyx_RefNannyFinishContext();
7692 : return __pyx_r;
7693 : }
7694 :
7695 5 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7696 5 : int __pyx_r;
7697 : __Pyx_RefNannyDeclarations
7698 5 : __Pyx_RefNannySetupContext("__init__", 1);
7699 :
7700 : /* "View.MemoryView":305
7701 : * cdef object name
7702 : * def __init__(self, name):
7703 : * self.name = name # <<<<<<<<<<<<<<
7704 : * def __repr__(self):
7705 : * return self.name
7706 : */
7707 5 : __Pyx_INCREF(__pyx_v_name);
7708 5 : __Pyx_GIVEREF(__pyx_v_name);
7709 5 : __Pyx_GOTREF(__pyx_v_self->name);
7710 5 : __Pyx_DECREF(__pyx_v_self->name);
7711 5 : __pyx_v_self->name = __pyx_v_name;
7712 :
7713 : /* "View.MemoryView":304
7714 : * cdef class Enum(object):
7715 : * cdef object name
7716 : * def __init__(self, name): # <<<<<<<<<<<<<<
7717 : * self.name = name
7718 : * def __repr__(self):
7719 : */
7720 :
7721 : /* function exit code */
7722 5 : __pyx_r = 0;
7723 5 : __Pyx_RefNannyFinishContext();
7724 5 : return __pyx_r;
7725 : }
7726 :
7727 : /* "View.MemoryView":306
7728 : * def __init__(self, name):
7729 : * self.name = name
7730 : * def __repr__(self): # <<<<<<<<<<<<<<
7731 : * return self.name
7732 : *
7733 : */
7734 :
7735 : /* Python wrapper */
7736 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
7737 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7738 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7739 0 : PyObject *__pyx_r = 0;
7740 : __Pyx_RefNannyDeclarations
7741 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
7742 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7743 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7744 :
7745 : /* function exit code */
7746 0 : __Pyx_RefNannyFinishContext();
7747 0 : return __pyx_r;
7748 : }
7749 :
7750 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7751 0 : PyObject *__pyx_r = NULL;
7752 : __Pyx_RefNannyDeclarations
7753 0 : __Pyx_RefNannySetupContext("__repr__", 1);
7754 :
7755 : /* "View.MemoryView":307
7756 : * self.name = name
7757 : * def __repr__(self):
7758 : * return self.name # <<<<<<<<<<<<<<
7759 : *
7760 : * cdef generic = Enum("<strided and direct or indirect>")
7761 : */
7762 0 : __Pyx_XDECREF(__pyx_r);
7763 0 : __Pyx_INCREF(__pyx_v_self->name);
7764 0 : __pyx_r = __pyx_v_self->name;
7765 0 : goto __pyx_L0;
7766 :
7767 : /* "View.MemoryView":306
7768 : * def __init__(self, name):
7769 : * self.name = name
7770 : * def __repr__(self): # <<<<<<<<<<<<<<
7771 : * return self.name
7772 : *
7773 : */
7774 :
7775 : /* function exit code */
7776 0 : __pyx_L0:;
7777 0 : __Pyx_XGIVEREF(__pyx_r);
7778 0 : __Pyx_RefNannyFinishContext();
7779 0 : return __pyx_r;
7780 : }
7781 :
7782 : /* "(tree fragment)":1
7783 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7784 : * cdef tuple state
7785 : * cdef object _dict
7786 : */
7787 :
7788 : /* Python wrapper */
7789 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7790 : #if CYTHON_METH_FASTCALL
7791 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7792 : #else
7793 : PyObject *__pyx_args, PyObject *__pyx_kwds
7794 : #endif
7795 : ); /*proto*/
7796 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7797 : #if CYTHON_METH_FASTCALL
7798 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7799 : #else
7800 : PyObject *__pyx_args, PyObject *__pyx_kwds
7801 : #endif
7802 : ) {
7803 : #if !CYTHON_METH_FASTCALL
7804 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7805 : #endif
7806 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7807 0 : PyObject *__pyx_r = 0;
7808 : __Pyx_RefNannyDeclarations
7809 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7810 : #if !CYTHON_METH_FASTCALL
7811 : #if CYTHON_ASSUME_SAFE_MACROS
7812 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7813 : #else
7814 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7815 : #endif
7816 : #endif
7817 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7818 0 : if (unlikely(__pyx_nargs > 0)) {
7819 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7820 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7821 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7822 :
7823 : /* function exit code */
7824 0 : __Pyx_RefNannyFinishContext();
7825 0 : return __pyx_r;
7826 : }
7827 :
7828 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7829 0 : PyObject *__pyx_v_state = 0;
7830 0 : PyObject *__pyx_v__dict = 0;
7831 0 : int __pyx_v_use_setstate;
7832 0 : PyObject *__pyx_r = NULL;
7833 : __Pyx_RefNannyDeclarations
7834 0 : PyObject *__pyx_t_1 = NULL;
7835 0 : int __pyx_t_2;
7836 0 : PyObject *__pyx_t_3 = NULL;
7837 0 : PyObject *__pyx_t_4 = NULL;
7838 0 : int __pyx_lineno = 0;
7839 0 : const char *__pyx_filename = NULL;
7840 0 : int __pyx_clineno = 0;
7841 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7842 :
7843 : /* "(tree fragment)":5
7844 : * cdef object _dict
7845 : * cdef bint use_setstate
7846 : * state = (self.name,) # <<<<<<<<<<<<<<
7847 : * _dict = getattr(self, '__dict__', None)
7848 : * if _dict is not None:
7849 : */
7850 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7851 0 : __Pyx_GOTREF(__pyx_t_1);
7852 0 : __Pyx_INCREF(__pyx_v_self->name);
7853 0 : __Pyx_GIVEREF(__pyx_v_self->name);
7854 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
7855 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
7856 0 : __pyx_t_1 = 0;
7857 :
7858 : /* "(tree fragment)":6
7859 : * cdef bint use_setstate
7860 : * state = (self.name,)
7861 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7862 : * if _dict is not None:
7863 : * state += (_dict,)
7864 : */
7865 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7866 0 : __Pyx_GOTREF(__pyx_t_1);
7867 0 : __pyx_v__dict = __pyx_t_1;
7868 0 : __pyx_t_1 = 0;
7869 :
7870 : /* "(tree fragment)":7
7871 : * state = (self.name,)
7872 : * _dict = getattr(self, '__dict__', None)
7873 : * if _dict is not None: # <<<<<<<<<<<<<<
7874 : * state += (_dict,)
7875 : * use_setstate = True
7876 : */
7877 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
7878 0 : if (__pyx_t_2) {
7879 :
7880 : /* "(tree fragment)":8
7881 : * _dict = getattr(self, '__dict__', None)
7882 : * if _dict is not None:
7883 : * state += (_dict,) # <<<<<<<<<<<<<<
7884 : * use_setstate = True
7885 : * else:
7886 : */
7887 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7888 0 : __Pyx_GOTREF(__pyx_t_1);
7889 0 : __Pyx_INCREF(__pyx_v__dict);
7890 0 : __Pyx_GIVEREF(__pyx_v__dict);
7891 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
7892 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
7893 0 : __Pyx_GOTREF(__pyx_t_3);
7894 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7895 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
7896 0 : __pyx_t_3 = 0;
7897 :
7898 : /* "(tree fragment)":9
7899 : * if _dict is not None:
7900 : * state += (_dict,)
7901 : * use_setstate = True # <<<<<<<<<<<<<<
7902 : * else:
7903 : * use_setstate = self.name is not None
7904 : */
7905 0 : __pyx_v_use_setstate = 1;
7906 :
7907 : /* "(tree fragment)":7
7908 : * state = (self.name,)
7909 : * _dict = getattr(self, '__dict__', None)
7910 : * if _dict is not None: # <<<<<<<<<<<<<<
7911 : * state += (_dict,)
7912 : * use_setstate = True
7913 : */
7914 0 : goto __pyx_L3;
7915 : }
7916 :
7917 : /* "(tree fragment)":11
7918 : * use_setstate = True
7919 : * else:
7920 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7921 : * if use_setstate:
7922 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7923 : */
7924 0 : /*else*/ {
7925 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
7926 0 : __pyx_v_use_setstate = __pyx_t_2;
7927 : }
7928 0 : __pyx_L3:;
7929 :
7930 : /* "(tree fragment)":12
7931 : * else:
7932 : * use_setstate = self.name is not None
7933 : * if use_setstate: # <<<<<<<<<<<<<<
7934 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7935 : * else:
7936 : */
7937 0 : if (__pyx_v_use_setstate) {
7938 :
7939 : /* "(tree fragment)":13
7940 : * use_setstate = self.name is not None
7941 : * if use_setstate:
7942 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7943 : * else:
7944 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7945 : */
7946 0 : __Pyx_XDECREF(__pyx_r);
7947 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
7948 0 : __Pyx_GOTREF(__pyx_t_3);
7949 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7950 0 : __Pyx_GOTREF(__pyx_t_1);
7951 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7952 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7953 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
7954 0 : __Pyx_INCREF(__pyx_int_136983863);
7955 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7956 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
7957 0 : __Pyx_INCREF(Py_None);
7958 0 : __Pyx_GIVEREF(Py_None);
7959 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
7960 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7961 0 : __Pyx_GOTREF(__pyx_t_4);
7962 0 : __Pyx_GIVEREF(__pyx_t_3);
7963 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
7964 0 : __Pyx_GIVEREF(__pyx_t_1);
7965 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
7966 0 : __Pyx_INCREF(__pyx_v_state);
7967 0 : __Pyx_GIVEREF(__pyx_v_state);
7968 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
7969 0 : __pyx_t_3 = 0;
7970 0 : __pyx_t_1 = 0;
7971 0 : __pyx_r = __pyx_t_4;
7972 0 : __pyx_t_4 = 0;
7973 0 : goto __pyx_L0;
7974 :
7975 : /* "(tree fragment)":12
7976 : * else:
7977 : * use_setstate = self.name is not None
7978 : * if use_setstate: # <<<<<<<<<<<<<<
7979 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7980 : * else:
7981 : */
7982 : }
7983 :
7984 : /* "(tree fragment)":15
7985 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7986 : * else:
7987 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7988 : * def __setstate_cython__(self, __pyx_state):
7989 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7990 : */
7991 0 : /*else*/ {
7992 0 : __Pyx_XDECREF(__pyx_r);
7993 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7994 0 : __Pyx_GOTREF(__pyx_t_4);
7995 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7996 0 : __Pyx_GOTREF(__pyx_t_1);
7997 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7998 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7999 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
8000 0 : __Pyx_INCREF(__pyx_int_136983863);
8001 0 : __Pyx_GIVEREF(__pyx_int_136983863);
8002 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
8003 0 : __Pyx_INCREF(__pyx_v_state);
8004 0 : __Pyx_GIVEREF(__pyx_v_state);
8005 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
8006 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
8007 0 : __Pyx_GOTREF(__pyx_t_3);
8008 0 : __Pyx_GIVEREF(__pyx_t_4);
8009 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
8010 0 : __Pyx_GIVEREF(__pyx_t_1);
8011 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
8012 0 : __pyx_t_4 = 0;
8013 0 : __pyx_t_1 = 0;
8014 0 : __pyx_r = __pyx_t_3;
8015 0 : __pyx_t_3 = 0;
8016 0 : goto __pyx_L0;
8017 : }
8018 :
8019 : /* "(tree fragment)":1
8020 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8021 : * cdef tuple state
8022 : * cdef object _dict
8023 : */
8024 :
8025 : /* function exit code */
8026 0 : __pyx_L1_error:;
8027 0 : __Pyx_XDECREF(__pyx_t_1);
8028 0 : __Pyx_XDECREF(__pyx_t_3);
8029 0 : __Pyx_XDECREF(__pyx_t_4);
8030 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8031 0 : __pyx_r = NULL;
8032 0 : __pyx_L0:;
8033 0 : __Pyx_XDECREF(__pyx_v_state);
8034 0 : __Pyx_XDECREF(__pyx_v__dict);
8035 0 : __Pyx_XGIVEREF(__pyx_r);
8036 0 : __Pyx_RefNannyFinishContext();
8037 0 : return __pyx_r;
8038 : }
8039 :
8040 : /* "(tree fragment)":16
8041 : * else:
8042 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8043 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8044 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8045 : */
8046 :
8047 : /* Python wrapper */
8048 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
8049 : #if CYTHON_METH_FASTCALL
8050 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8051 : #else
8052 : PyObject *__pyx_args, PyObject *__pyx_kwds
8053 : #endif
8054 : ); /*proto*/
8055 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
8056 : #if CYTHON_METH_FASTCALL
8057 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8058 : #else
8059 : PyObject *__pyx_args, PyObject *__pyx_kwds
8060 : #endif
8061 : ) {
8062 0 : PyObject *__pyx_v___pyx_state = 0;
8063 : #if !CYTHON_METH_FASTCALL
8064 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8065 : #endif
8066 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8067 0 : PyObject* values[1] = {0};
8068 0 : int __pyx_lineno = 0;
8069 0 : const char *__pyx_filename = NULL;
8070 0 : int __pyx_clineno = 0;
8071 0 : PyObject *__pyx_r = 0;
8072 : __Pyx_RefNannyDeclarations
8073 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8074 : #if !CYTHON_METH_FASTCALL
8075 : #if CYTHON_ASSUME_SAFE_MACROS
8076 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8077 : #else
8078 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8079 : #endif
8080 : #endif
8081 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8082 0 : {
8083 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
8084 0 : if (__pyx_kwds) {
8085 0 : Py_ssize_t kw_args;
8086 0 : switch (__pyx_nargs) {
8087 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
8088 0 : CYTHON_FALLTHROUGH;
8089 0 : case 0: break;
8090 0 : default: goto __pyx_L5_argtuple_error;
8091 : }
8092 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
8093 0 : switch (__pyx_nargs) {
8094 0 : case 0:
8095 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
8096 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
8097 0 : kw_args--;
8098 : }
8099 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
8100 0 : else goto __pyx_L5_argtuple_error;
8101 : }
8102 0 : if (unlikely(kw_args > 0)) {
8103 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8104 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
8105 : }
8106 0 : } else if (unlikely(__pyx_nargs != 1)) {
8107 0 : goto __pyx_L5_argtuple_error;
8108 : } else {
8109 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
8110 : }
8111 0 : __pyx_v___pyx_state = values[0];
8112 : }
8113 0 : goto __pyx_L6_skip;
8114 0 : __pyx_L5_argtuple_error:;
8115 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
8116 0 : __pyx_L6_skip:;
8117 0 : goto __pyx_L4_argument_unpacking_done;
8118 0 : __pyx_L3_error:;
8119 0 : {
8120 0 : Py_ssize_t __pyx_temp;
8121 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8122 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
8123 : }
8124 : }
8125 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8126 : __Pyx_RefNannyFinishContext();
8127 : return NULL;
8128 0 : __pyx_L4_argument_unpacking_done:;
8129 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
8130 :
8131 : /* function exit code */
8132 : {
8133 : Py_ssize_t __pyx_temp;
8134 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8135 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
8136 : }
8137 : }
8138 : __Pyx_RefNannyFinishContext();
8139 : return __pyx_r;
8140 : }
8141 :
8142 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8143 0 : PyObject *__pyx_r = NULL;
8144 : __Pyx_RefNannyDeclarations
8145 0 : PyObject *__pyx_t_1 = NULL;
8146 0 : int __pyx_lineno = 0;
8147 0 : const char *__pyx_filename = NULL;
8148 0 : int __pyx_clineno = 0;
8149 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
8150 :
8151 : /* "(tree fragment)":17
8152 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8153 : * def __setstate_cython__(self, __pyx_state):
8154 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
8155 : */
8156 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
8157 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8158 0 : __Pyx_GOTREF(__pyx_t_1);
8159 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8160 :
8161 : /* "(tree fragment)":16
8162 : * else:
8163 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8164 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8165 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8166 : */
8167 :
8168 : /* function exit code */
8169 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8170 0 : goto __pyx_L0;
8171 0 : __pyx_L1_error:;
8172 0 : __Pyx_XDECREF(__pyx_t_1);
8173 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8174 0 : __pyx_r = NULL;
8175 0 : __pyx_L0:;
8176 0 : __Pyx_XGIVEREF(__pyx_r);
8177 0 : __Pyx_RefNannyFinishContext();
8178 0 : return __pyx_r;
8179 : }
8180 :
8181 : /* "View.MemoryView":349
8182 : * cdef __Pyx_TypeInfo *typeinfo
8183 : *
8184 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8185 : * self.obj = obj
8186 : * self.flags = flags
8187 : */
8188 :
8189 : /* Python wrapper */
8190 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8191 16351 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8192 16351 : PyObject *__pyx_v_obj = 0;
8193 16351 : int __pyx_v_flags;
8194 16351 : int __pyx_v_dtype_is_object;
8195 16351 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8196 16351 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8197 16351 : PyObject* values[3] = {0,0,0};
8198 16351 : int __pyx_lineno = 0;
8199 16351 : const char *__pyx_filename = NULL;
8200 16351 : int __pyx_clineno = 0;
8201 16351 : int __pyx_r;
8202 : __Pyx_RefNannyDeclarations
8203 16351 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8204 : #if CYTHON_ASSUME_SAFE_MACROS
8205 16351 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8206 : #else
8207 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
8208 : #endif
8209 16351 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8210 16351 : {
8211 16351 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8212 16351 : if (__pyx_kwds) {
8213 0 : Py_ssize_t kw_args;
8214 0 : switch (__pyx_nargs) {
8215 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
8216 0 : CYTHON_FALLTHROUGH;
8217 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
8218 0 : CYTHON_FALLTHROUGH;
8219 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8220 0 : CYTHON_FALLTHROUGH;
8221 0 : case 0: break;
8222 0 : default: goto __pyx_L5_argtuple_error;
8223 : }
8224 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
8225 0 : switch (__pyx_nargs) {
8226 0 : case 0:
8227 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
8228 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
8229 0 : kw_args--;
8230 : }
8231 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8232 0 : else goto __pyx_L5_argtuple_error;
8233 0 : CYTHON_FALLTHROUGH;
8234 0 : case 1:
8235 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
8236 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
8237 0 : kw_args--;
8238 : }
8239 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8240 : else {
8241 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
8242 : }
8243 0 : CYTHON_FALLTHROUGH;
8244 0 : case 2:
8245 0 : if (kw_args > 0) {
8246 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
8247 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
8248 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8249 : }
8250 : }
8251 0 : if (unlikely(kw_args > 0)) {
8252 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8253 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
8254 : }
8255 : } else {
8256 16351 : switch (__pyx_nargs) {
8257 16351 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
8258 16351 : CYTHON_FALLTHROUGH;
8259 16351 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
8260 16351 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8261 16351 : break;
8262 0 : default: goto __pyx_L5_argtuple_error;
8263 : }
8264 : }
8265 16351 : __pyx_v_obj = values[0];
8266 16351 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8267 16351 : if (values[2]) {
8268 16351 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8269 : } else {
8270 : __pyx_v_dtype_is_object = ((int)0);
8271 : }
8272 : }
8273 16351 : goto __pyx_L6_skip;
8274 0 : __pyx_L5_argtuple_error:;
8275 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
8276 16351 : __pyx_L6_skip:;
8277 16351 : goto __pyx_L4_argument_unpacking_done;
8278 0 : __pyx_L3_error:;
8279 0 : {
8280 0 : Py_ssize_t __pyx_temp;
8281 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8282 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
8283 : }
8284 : }
8285 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8286 : __Pyx_RefNannyFinishContext();
8287 : return -1;
8288 16351 : __pyx_L4_argument_unpacking_done:;
8289 16351 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8290 :
8291 : /* function exit code */
8292 : {
8293 : Py_ssize_t __pyx_temp;
8294 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8295 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
8296 : }
8297 : }
8298 : __Pyx_RefNannyFinishContext();
8299 : return __pyx_r;
8300 : }
8301 :
8302 16351 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
8303 16351 : int __pyx_r;
8304 : __Pyx_RefNannyDeclarations
8305 16351 : int __pyx_t_1;
8306 16351 : int __pyx_t_2;
8307 16351 : int __pyx_t_3;
8308 16351 : Py_intptr_t __pyx_t_4;
8309 16351 : size_t __pyx_t_5;
8310 16351 : int __pyx_lineno = 0;
8311 16351 : const char *__pyx_filename = NULL;
8312 16351 : int __pyx_clineno = 0;
8313 16351 : __Pyx_RefNannySetupContext("__cinit__", 1);
8314 :
8315 : /* "View.MemoryView":350
8316 : *
8317 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8318 : * self.obj = obj # <<<<<<<<<<<<<<
8319 : * self.flags = flags
8320 : * if type(self) is memoryview or obj is not None:
8321 : */
8322 16351 : __Pyx_INCREF(__pyx_v_obj);
8323 16351 : __Pyx_GIVEREF(__pyx_v_obj);
8324 16351 : __Pyx_GOTREF(__pyx_v_self->obj);
8325 16351 : __Pyx_DECREF(__pyx_v_self->obj);
8326 16351 : __pyx_v_self->obj = __pyx_v_obj;
8327 :
8328 : /* "View.MemoryView":351
8329 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8330 : * self.obj = obj
8331 : * self.flags = flags # <<<<<<<<<<<<<<
8332 : * if type(self) is memoryview or obj is not None:
8333 : * __Pyx_GetBuffer(obj, &self.view, flags)
8334 : */
8335 16351 : __pyx_v_self->flags = __pyx_v_flags;
8336 :
8337 : /* "View.MemoryView":352
8338 : * self.obj = obj
8339 : * self.flags = flags
8340 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8341 : * __Pyx_GetBuffer(obj, &self.view, flags)
8342 : * if <PyObject *> self.view.obj == NULL:
8343 : */
8344 16351 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8345 16351 : if (!__pyx_t_2) {
8346 : } else {
8347 10006 : __pyx_t_1 = __pyx_t_2;
8348 10006 : goto __pyx_L4_bool_binop_done;
8349 : }
8350 6345 : __pyx_t_2 = (__pyx_v_obj != Py_None);
8351 6345 : __pyx_t_1 = __pyx_t_2;
8352 16351 : __pyx_L4_bool_binop_done:;
8353 16351 : if (__pyx_t_1) {
8354 :
8355 : /* "View.MemoryView":353
8356 : * self.flags = flags
8357 : * if type(self) is memoryview or obj is not None:
8358 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
8359 : * if <PyObject *> self.view.obj == NULL:
8360 : * (<__pyx_buffer *> &self.view).obj = Py_None
8361 : */
8362 10006 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
8363 :
8364 : /* "View.MemoryView":354
8365 : * if type(self) is memoryview or obj is not None:
8366 : * __Pyx_GetBuffer(obj, &self.view, flags)
8367 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8368 : * (<__pyx_buffer *> &self.view).obj = Py_None
8369 : * Py_INCREF(Py_None)
8370 : */
8371 10006 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
8372 10006 : if (__pyx_t_1) {
8373 :
8374 : /* "View.MemoryView":355
8375 : * __Pyx_GetBuffer(obj, &self.view, flags)
8376 : * if <PyObject *> self.view.obj == NULL:
8377 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
8378 : * Py_INCREF(Py_None)
8379 : *
8380 : */
8381 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8382 :
8383 : /* "View.MemoryView":356
8384 : * if <PyObject *> self.view.obj == NULL:
8385 : * (<__pyx_buffer *> &self.view).obj = Py_None
8386 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8387 : *
8388 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
8389 : */
8390 0 : Py_INCREF(Py_None);
8391 :
8392 : /* "View.MemoryView":354
8393 : * if type(self) is memoryview or obj is not None:
8394 : * __Pyx_GetBuffer(obj, &self.view, flags)
8395 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8396 : * (<__pyx_buffer *> &self.view).obj = Py_None
8397 : * Py_INCREF(Py_None)
8398 : */
8399 : }
8400 :
8401 : /* "View.MemoryView":352
8402 : * self.obj = obj
8403 : * self.flags = flags
8404 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8405 : * __Pyx_GetBuffer(obj, &self.view, flags)
8406 : * if <PyObject *> self.view.obj == NULL:
8407 : */
8408 : }
8409 :
8410 : /* "View.MemoryView":358
8411 : * Py_INCREF(Py_None)
8412 : *
8413 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8414 : * global __pyx_memoryview_thread_locks_used
8415 : * if __pyx_memoryview_thread_locks_used < 8:
8416 : */
8417 16351 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
8418 16351 : if (__pyx_t_1) {
8419 :
8420 : /* "View.MemoryView":360
8421 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
8422 : * global __pyx_memoryview_thread_locks_used
8423 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
8424 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8425 : * __pyx_memoryview_thread_locks_used += 1
8426 : */
8427 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
8428 : if (__pyx_t_1) {
8429 :
8430 : /* "View.MemoryView":361
8431 : * global __pyx_memoryview_thread_locks_used
8432 : * if __pyx_memoryview_thread_locks_used < 8:
8433 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
8434 : * __pyx_memoryview_thread_locks_used += 1
8435 : * if self.lock is NULL:
8436 : */
8437 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8438 :
8439 : /* "View.MemoryView":362
8440 : * if __pyx_memoryview_thread_locks_used < 8:
8441 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8442 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
8443 : * if self.lock is NULL:
8444 : * self.lock = PyThread_allocate_lock()
8445 : */
8446 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8447 :
8448 : /* "View.MemoryView":360
8449 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
8450 : * global __pyx_memoryview_thread_locks_used
8451 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
8452 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8453 : * __pyx_memoryview_thread_locks_used += 1
8454 : */
8455 : }
8456 :
8457 : /* "View.MemoryView":363
8458 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8459 : * __pyx_memoryview_thread_locks_used += 1
8460 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8461 : * self.lock = PyThread_allocate_lock()
8462 : * if self.lock is NULL:
8463 : */
8464 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
8465 : if (__pyx_t_1) {
8466 :
8467 : /* "View.MemoryView":364
8468 : * __pyx_memoryview_thread_locks_used += 1
8469 : * if self.lock is NULL:
8470 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
8471 : * if self.lock is NULL:
8472 : * raise MemoryError
8473 : */
8474 : __pyx_v_self->lock = PyThread_allocate_lock();
8475 :
8476 : /* "View.MemoryView":365
8477 : * if self.lock is NULL:
8478 : * self.lock = PyThread_allocate_lock()
8479 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8480 : * raise MemoryError
8481 : *
8482 : */
8483 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
8484 : if (unlikely(__pyx_t_1)) {
8485 :
8486 : /* "View.MemoryView":366
8487 : * self.lock = PyThread_allocate_lock()
8488 : * if self.lock is NULL:
8489 : * raise MemoryError # <<<<<<<<<<<<<<
8490 : *
8491 : * if flags & PyBUF_FORMAT:
8492 : */
8493 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
8494 :
8495 : /* "View.MemoryView":365
8496 : * if self.lock is NULL:
8497 : * self.lock = PyThread_allocate_lock()
8498 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8499 : * raise MemoryError
8500 : *
8501 : */
8502 : }
8503 :
8504 : /* "View.MemoryView":363
8505 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8506 : * __pyx_memoryview_thread_locks_used += 1
8507 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8508 : * self.lock = PyThread_allocate_lock()
8509 : * if self.lock is NULL:
8510 : */
8511 : }
8512 :
8513 : /* "View.MemoryView":358
8514 : * Py_INCREF(Py_None)
8515 : *
8516 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8517 : * global __pyx_memoryview_thread_locks_used
8518 : * if __pyx_memoryview_thread_locks_used < 8:
8519 : */
8520 : }
8521 :
8522 : /* "View.MemoryView":368
8523 : * raise MemoryError
8524 : *
8525 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8526 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8527 : * else:
8528 : */
8529 16351 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8530 16351 : if (__pyx_t_1) {
8531 :
8532 : /* "View.MemoryView":369
8533 : *
8534 : * if flags & PyBUF_FORMAT:
8535 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
8536 : * else:
8537 : * self.dtype_is_object = dtype_is_object
8538 : */
8539 10006 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
8540 10006 : if (__pyx_t_2) {
8541 : } else {
8542 10006 : __pyx_t_1 = __pyx_t_2;
8543 10006 : goto __pyx_L12_bool_binop_done;
8544 : }
8545 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
8546 0 : __pyx_t_1 = __pyx_t_2;
8547 10006 : __pyx_L12_bool_binop_done:;
8548 10006 : __pyx_v_self->dtype_is_object = __pyx_t_1;
8549 :
8550 : /* "View.MemoryView":368
8551 : * raise MemoryError
8552 : *
8553 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8554 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8555 : * else:
8556 : */
8557 10006 : goto __pyx_L11;
8558 : }
8559 :
8560 : /* "View.MemoryView":371
8561 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8562 : * else:
8563 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8564 : *
8565 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8566 : */
8567 6345 : /*else*/ {
8568 6345 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8569 : }
8570 16351 : __pyx_L11:;
8571 :
8572 : /* "View.MemoryView":373
8573 : * self.dtype_is_object = dtype_is_object
8574 : *
8575 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
8576 : * self.typeinfo = NULL
8577 : *
8578 : */
8579 : #ifndef CYTHON_WITHOUT_ASSERTIONS
8580 16351 : if (unlikely(__pyx_assertions_enabled())) {
8581 16351 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
8582 16351 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
8583 16351 : if (unlikely(__pyx_t_5 == 0)) {
8584 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8585 : __PYX_ERR(1, 373, __pyx_L1_error)
8586 : }
8587 16351 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
8588 16351 : if (unlikely(!__pyx_t_1)) {
8589 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
8590 0 : __PYX_ERR(1, 373, __pyx_L1_error)
8591 : }
8592 : }
8593 : #else
8594 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
8595 : #endif
8596 :
8597 : /* "View.MemoryView":374
8598 : *
8599 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8600 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
8601 : *
8602 : * def __dealloc__(memoryview self):
8603 : */
8604 16351 : __pyx_v_self->typeinfo = NULL;
8605 :
8606 : /* "View.MemoryView":349
8607 : * cdef __Pyx_TypeInfo *typeinfo
8608 : *
8609 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8610 : * self.obj = obj
8611 : * self.flags = flags
8612 : */
8613 :
8614 : /* function exit code */
8615 16351 : __pyx_r = 0;
8616 16351 : goto __pyx_L0;
8617 0 : __pyx_L1_error:;
8618 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8619 0 : __pyx_r = -1;
8620 16351 : __pyx_L0:;
8621 16351 : __Pyx_RefNannyFinishContext();
8622 16351 : return __pyx_r;
8623 : }
8624 :
8625 : /* "View.MemoryView":376
8626 : * self.typeinfo = NULL
8627 : *
8628 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8629 : * if self.obj is not None:
8630 : * __Pyx_ReleaseBuffer(&self.view)
8631 : */
8632 :
8633 : /* Python wrapper */
8634 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
8635 16351 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8636 16351 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8637 : __Pyx_RefNannyDeclarations
8638 16351 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8639 16351 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8640 16351 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8641 :
8642 : /* function exit code */
8643 16351 : __Pyx_RefNannyFinishContext();
8644 : }
8645 :
8646 16351 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8647 16351 : int __pyx_v_i;
8648 16351 : int __pyx_t_1;
8649 16351 : int __pyx_t_2;
8650 16351 : int __pyx_t_3;
8651 16351 : int __pyx_t_4;
8652 16351 : PyThread_type_lock __pyx_t_5;
8653 16351 : PyThread_type_lock __pyx_t_6;
8654 :
8655 : /* "View.MemoryView":377
8656 : *
8657 : * def __dealloc__(memoryview self):
8658 : * if self.obj is not None: # <<<<<<<<<<<<<<
8659 : * __Pyx_ReleaseBuffer(&self.view)
8660 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8661 : */
8662 16351 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8663 16351 : if (__pyx_t_1) {
8664 :
8665 : /* "View.MemoryView":378
8666 : * def __dealloc__(memoryview self):
8667 : * if self.obj is not None:
8668 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
8669 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8670 : *
8671 : */
8672 10006 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8673 :
8674 : /* "View.MemoryView":377
8675 : *
8676 : * def __dealloc__(memoryview self):
8677 : * if self.obj is not None: # <<<<<<<<<<<<<<
8678 : * __Pyx_ReleaseBuffer(&self.view)
8679 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8680 : */
8681 10006 : goto __pyx_L3;
8682 : }
8683 :
8684 : /* "View.MemoryView":379
8685 : * if self.obj is not None:
8686 : * __Pyx_ReleaseBuffer(&self.view)
8687 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8688 : *
8689 : * (<__pyx_buffer *> &self.view).obj = NULL
8690 : */
8691 6345 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8692 6345 : if (__pyx_t_1) {
8693 :
8694 : /* "View.MemoryView":381
8695 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8696 : *
8697 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8698 : * Py_DECREF(Py_None)
8699 : *
8700 : */
8701 6345 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8702 :
8703 : /* "View.MemoryView":382
8704 : *
8705 : * (<__pyx_buffer *> &self.view).obj = NULL
8706 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
8707 : *
8708 : * cdef int i
8709 : */
8710 6345 : Py_DECREF(Py_None);
8711 :
8712 : /* "View.MemoryView":379
8713 : * if self.obj is not None:
8714 : * __Pyx_ReleaseBuffer(&self.view)
8715 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8716 : *
8717 : * (<__pyx_buffer *> &self.view).obj = NULL
8718 : */
8719 : }
8720 0 : __pyx_L3:;
8721 :
8722 : /* "View.MemoryView":386
8723 : * cdef int i
8724 : * global __pyx_memoryview_thread_locks_used
8725 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8726 : * for i in range(__pyx_memoryview_thread_locks_used):
8727 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8728 : */
8729 16351 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
8730 16351 : if (__pyx_t_1) {
8731 :
8732 : /* "View.MemoryView":387
8733 : * global __pyx_memoryview_thread_locks_used
8734 : * if self.lock != NULL:
8735 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8736 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8737 : * __pyx_memoryview_thread_locks_used -= 1
8738 : */
8739 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8740 0 : __pyx_t_3 = __pyx_t_2;
8741 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8742 0 : __pyx_v_i = __pyx_t_4;
8743 :
8744 : /* "View.MemoryView":388
8745 : * if self.lock != NULL:
8746 : * for i in range(__pyx_memoryview_thread_locks_used):
8747 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8748 : * __pyx_memoryview_thread_locks_used -= 1
8749 : * if i != __pyx_memoryview_thread_locks_used:
8750 : */
8751 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8752 0 : if (__pyx_t_1) {
8753 :
8754 : /* "View.MemoryView":389
8755 : * for i in range(__pyx_memoryview_thread_locks_used):
8756 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8757 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8758 : * if i != __pyx_memoryview_thread_locks_used:
8759 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8760 : */
8761 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8762 :
8763 : /* "View.MemoryView":390
8764 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8765 : * __pyx_memoryview_thread_locks_used -= 1
8766 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8767 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8768 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8769 : */
8770 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8771 0 : if (__pyx_t_1) {
8772 :
8773 : /* "View.MemoryView":392
8774 : * if i != __pyx_memoryview_thread_locks_used:
8775 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8776 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8777 : * break
8778 : * else:
8779 : */
8780 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8781 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8782 :
8783 : /* "View.MemoryView":391
8784 : * __pyx_memoryview_thread_locks_used -= 1
8785 : * if i != __pyx_memoryview_thread_locks_used:
8786 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8787 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8788 : * break
8789 : */
8790 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8791 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8792 :
8793 : /* "View.MemoryView":390
8794 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8795 : * __pyx_memoryview_thread_locks_used -= 1
8796 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8797 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8798 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8799 : */
8800 : }
8801 :
8802 : /* "View.MemoryView":393
8803 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8804 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8805 : * break # <<<<<<<<<<<<<<
8806 : * else:
8807 : * PyThread_free_lock(self.lock)
8808 : */
8809 0 : goto __pyx_L6_break;
8810 :
8811 : /* "View.MemoryView":388
8812 : * if self.lock != NULL:
8813 : * for i in range(__pyx_memoryview_thread_locks_used):
8814 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8815 : * __pyx_memoryview_thread_locks_used -= 1
8816 : * if i != __pyx_memoryview_thread_locks_used:
8817 : */
8818 : }
8819 : }
8820 0 : /*else*/ {
8821 :
8822 : /* "View.MemoryView":395
8823 : * break
8824 : * else:
8825 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8826 : *
8827 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8828 : */
8829 0 : PyThread_free_lock(__pyx_v_self->lock);
8830 : }
8831 16351 : __pyx_L6_break:;
8832 :
8833 : /* "View.MemoryView":386
8834 : * cdef int i
8835 : * global __pyx_memoryview_thread_locks_used
8836 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8837 : * for i in range(__pyx_memoryview_thread_locks_used):
8838 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8839 : */
8840 : }
8841 :
8842 : /* "View.MemoryView":376
8843 : * self.typeinfo = NULL
8844 : *
8845 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8846 : * if self.obj is not None:
8847 : * __Pyx_ReleaseBuffer(&self.view)
8848 : */
8849 :
8850 : /* function exit code */
8851 16351 : }
8852 :
8853 : /* "View.MemoryView":397
8854 : * PyThread_free_lock(self.lock)
8855 : *
8856 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8857 : * cdef Py_ssize_t dim
8858 : * cdef char *itemp = <char *> self.view.buf
8859 : */
8860 :
8861 0 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8862 0 : Py_ssize_t __pyx_v_dim;
8863 0 : char *__pyx_v_itemp;
8864 0 : PyObject *__pyx_v_idx = NULL;
8865 0 : char *__pyx_r;
8866 : __Pyx_RefNannyDeclarations
8867 0 : Py_ssize_t __pyx_t_1;
8868 0 : PyObject *__pyx_t_2 = NULL;
8869 0 : Py_ssize_t __pyx_t_3;
8870 0 : PyObject *(*__pyx_t_4)(PyObject *);
8871 0 : PyObject *__pyx_t_5 = NULL;
8872 0 : Py_ssize_t __pyx_t_6;
8873 0 : char *__pyx_t_7;
8874 0 : int __pyx_lineno = 0;
8875 0 : const char *__pyx_filename = NULL;
8876 0 : int __pyx_clineno = 0;
8877 0 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
8878 :
8879 : /* "View.MemoryView":399
8880 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8881 : * cdef Py_ssize_t dim
8882 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8883 : *
8884 : * for dim, idx in enumerate(index):
8885 : */
8886 0 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8887 :
8888 : /* "View.MemoryView":401
8889 : * cdef char *itemp = <char *> self.view.buf
8890 : *
8891 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8892 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8893 : *
8894 : */
8895 0 : __pyx_t_1 = 0;
8896 0 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8897 0 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8898 0 : __pyx_t_3 = 0;
8899 0 : __pyx_t_4 = NULL;
8900 : } else {
8901 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
8902 0 : __Pyx_GOTREF(__pyx_t_2);
8903 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
8904 : }
8905 0 : for (;;) {
8906 0 : if (likely(!__pyx_t_4)) {
8907 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
8908 0 : {
8909 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
8910 : #if !CYTHON_ASSUME_SAFE_MACROS
8911 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8912 : #endif
8913 0 : if (__pyx_t_3 >= __pyx_temp) break;
8914 : }
8915 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8916 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8917 : #else
8918 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8919 : __Pyx_GOTREF(__pyx_t_5);
8920 : #endif
8921 : } else {
8922 0 : {
8923 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8924 : #if !CYTHON_ASSUME_SAFE_MACROS
8925 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8926 : #endif
8927 0 : if (__pyx_t_3 >= __pyx_temp) break;
8928 : }
8929 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8930 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8931 : #else
8932 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8933 : __Pyx_GOTREF(__pyx_t_5);
8934 : #endif
8935 : }
8936 : } else {
8937 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8938 0 : if (unlikely(!__pyx_t_5)) {
8939 0 : PyObject* exc_type = PyErr_Occurred();
8940 0 : if (exc_type) {
8941 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8942 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
8943 : }
8944 : break;
8945 : }
8946 0 : __Pyx_GOTREF(__pyx_t_5);
8947 : }
8948 0 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8949 0 : __pyx_t_5 = 0;
8950 0 : __pyx_v_dim = __pyx_t_1;
8951 0 : __pyx_t_1 = (__pyx_t_1 + 1);
8952 :
8953 : /* "View.MemoryView":402
8954 : *
8955 : * for dim, idx in enumerate(index):
8956 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8957 : *
8958 : * return itemp
8959 : */
8960 0 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
8961 0 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
8962 : __pyx_v_itemp = __pyx_t_7;
8963 :
8964 : /* "View.MemoryView":401
8965 : * cdef char *itemp = <char *> self.view.buf
8966 : *
8967 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8968 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8969 : *
8970 : */
8971 : }
8972 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8973 :
8974 : /* "View.MemoryView":404
8975 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8976 : *
8977 : * return itemp # <<<<<<<<<<<<<<
8978 : *
8979 : *
8980 : */
8981 0 : __pyx_r = __pyx_v_itemp;
8982 0 : goto __pyx_L0;
8983 :
8984 : /* "View.MemoryView":397
8985 : * PyThread_free_lock(self.lock)
8986 : *
8987 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8988 : * cdef Py_ssize_t dim
8989 : * cdef char *itemp = <char *> self.view.buf
8990 : */
8991 :
8992 : /* function exit code */
8993 0 : __pyx_L1_error:;
8994 0 : __Pyx_XDECREF(__pyx_t_2);
8995 0 : __Pyx_XDECREF(__pyx_t_5);
8996 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8997 0 : __pyx_r = NULL;
8998 0 : __pyx_L0:;
8999 0 : __Pyx_XDECREF(__pyx_v_idx);
9000 0 : __Pyx_RefNannyFinishContext();
9001 0 : return __pyx_r;
9002 : }
9003 :
9004 : /* "View.MemoryView":407
9005 : *
9006 : *
9007 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9008 : * if index is Ellipsis:
9009 : * return self
9010 : */
9011 :
9012 : /* Python wrapper */
9013 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
9014 1398 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9015 1398 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9016 1398 : PyObject *__pyx_r = 0;
9017 : __Pyx_RefNannyDeclarations
9018 1398 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9019 1398 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9020 1398 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9021 :
9022 : /* function exit code */
9023 1398 : __Pyx_RefNannyFinishContext();
9024 1398 : return __pyx_r;
9025 : }
9026 :
9027 1398 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9028 1398 : PyObject *__pyx_v_have_slices = NULL;
9029 1398 : PyObject *__pyx_v_indices = NULL;
9030 1398 : char *__pyx_v_itemp;
9031 1398 : PyObject *__pyx_r = NULL;
9032 : __Pyx_RefNannyDeclarations
9033 1398 : int __pyx_t_1;
9034 1398 : PyObject *__pyx_t_2 = NULL;
9035 1398 : PyObject *__pyx_t_3 = NULL;
9036 1398 : PyObject *__pyx_t_4 = NULL;
9037 1398 : char *__pyx_t_5;
9038 1398 : int __pyx_lineno = 0;
9039 1398 : const char *__pyx_filename = NULL;
9040 1398 : int __pyx_clineno = 0;
9041 1398 : __Pyx_RefNannySetupContext("__getitem__", 1);
9042 :
9043 : /* "View.MemoryView":408
9044 : *
9045 : * def __getitem__(memoryview self, object index):
9046 : * if index is Ellipsis: # <<<<<<<<<<<<<<
9047 : * return self
9048 : *
9049 : */
9050 1398 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9051 1398 : if (__pyx_t_1) {
9052 :
9053 : /* "View.MemoryView":409
9054 : * def __getitem__(memoryview self, object index):
9055 : * if index is Ellipsis:
9056 : * return self # <<<<<<<<<<<<<<
9057 : *
9058 : * have_slices, indices = _unellipsify(index, self.view.ndim)
9059 : */
9060 0 : __Pyx_XDECREF(__pyx_r);
9061 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
9062 0 : __pyx_r = ((PyObject *)__pyx_v_self);
9063 0 : goto __pyx_L0;
9064 :
9065 : /* "View.MemoryView":408
9066 : *
9067 : * def __getitem__(memoryview self, object index):
9068 : * if index is Ellipsis: # <<<<<<<<<<<<<<
9069 : * return self
9070 : *
9071 : */
9072 : }
9073 :
9074 : /* "View.MemoryView":411
9075 : * return self
9076 : *
9077 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9078 : *
9079 : * cdef char *itemp
9080 : */
9081 1398 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
9082 1398 : __Pyx_GOTREF(__pyx_t_2);
9083 1398 : if (likely(__pyx_t_2 != Py_None)) {
9084 1398 : PyObject* sequence = __pyx_t_2;
9085 1398 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9086 1398 : if (unlikely(size != 2)) {
9087 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9088 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9089 0 : __PYX_ERR(1, 411, __pyx_L1_error)
9090 : }
9091 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9092 1398 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9093 1398 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9094 1398 : __Pyx_INCREF(__pyx_t_3);
9095 1398 : __Pyx_INCREF(__pyx_t_4);
9096 : #else
9097 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
9098 : __Pyx_GOTREF(__pyx_t_3);
9099 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
9100 : __Pyx_GOTREF(__pyx_t_4);
9101 : #endif
9102 1398 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9103 : } else {
9104 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
9105 : }
9106 1398 : __pyx_v_have_slices = __pyx_t_3;
9107 1398 : __pyx_t_3 = 0;
9108 1398 : __pyx_v_indices = __pyx_t_4;
9109 1398 : __pyx_t_4 = 0;
9110 :
9111 : /* "View.MemoryView":414
9112 : *
9113 : * cdef char *itemp
9114 : * if have_slices: # <<<<<<<<<<<<<<
9115 : * return memview_slice(self, indices)
9116 : * else:
9117 : */
9118 1398 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
9119 1398 : if (__pyx_t_1) {
9120 :
9121 : /* "View.MemoryView":415
9122 : * cdef char *itemp
9123 : * if have_slices:
9124 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
9125 : * else:
9126 : * itemp = self.get_item_pointer(indices)
9127 : */
9128 1398 : __Pyx_XDECREF(__pyx_r);
9129 1398 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
9130 1398 : __Pyx_GOTREF(__pyx_t_2);
9131 1398 : __pyx_r = __pyx_t_2;
9132 1398 : __pyx_t_2 = 0;
9133 1398 : goto __pyx_L0;
9134 :
9135 : /* "View.MemoryView":414
9136 : *
9137 : * cdef char *itemp
9138 : * if have_slices: # <<<<<<<<<<<<<<
9139 : * return memview_slice(self, indices)
9140 : * else:
9141 : */
9142 : }
9143 :
9144 : /* "View.MemoryView":417
9145 : * return memview_slice(self, indices)
9146 : * else:
9147 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
9148 : * return self.convert_item_to_object(itemp)
9149 : *
9150 : */
9151 0 : /*else*/ {
9152 0 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
9153 0 : __pyx_v_itemp = __pyx_t_5;
9154 :
9155 : /* "View.MemoryView":418
9156 : * else:
9157 : * itemp = self.get_item_pointer(indices)
9158 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
9159 : *
9160 : * def __setitem__(memoryview self, object index, object value):
9161 : */
9162 0 : __Pyx_XDECREF(__pyx_r);
9163 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
9164 0 : __Pyx_GOTREF(__pyx_t_2);
9165 0 : __pyx_r = __pyx_t_2;
9166 0 : __pyx_t_2 = 0;
9167 0 : goto __pyx_L0;
9168 : }
9169 :
9170 : /* "View.MemoryView":407
9171 : *
9172 : *
9173 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9174 : * if index is Ellipsis:
9175 : * return self
9176 : */
9177 :
9178 : /* function exit code */
9179 0 : __pyx_L1_error:;
9180 0 : __Pyx_XDECREF(__pyx_t_2);
9181 0 : __Pyx_XDECREF(__pyx_t_3);
9182 0 : __Pyx_XDECREF(__pyx_t_4);
9183 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9184 0 : __pyx_r = NULL;
9185 1398 : __pyx_L0:;
9186 1398 : __Pyx_XDECREF(__pyx_v_have_slices);
9187 1398 : __Pyx_XDECREF(__pyx_v_indices);
9188 1398 : __Pyx_XGIVEREF(__pyx_r);
9189 1398 : __Pyx_RefNannyFinishContext();
9190 1398 : return __pyx_r;
9191 : }
9192 :
9193 : /* "View.MemoryView":420
9194 : * return self.convert_item_to_object(itemp)
9195 : *
9196 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9197 : * if self.view.readonly:
9198 : * raise TypeError, "Cannot assign to read-only memoryview"
9199 : */
9200 :
9201 : /* Python wrapper */
9202 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
9203 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9204 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9205 0 : int __pyx_r;
9206 : __Pyx_RefNannyDeclarations
9207 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9208 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9209 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9210 :
9211 : /* function exit code */
9212 0 : __Pyx_RefNannyFinishContext();
9213 0 : return __pyx_r;
9214 : }
9215 :
9216 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9217 0 : PyObject *__pyx_v_have_slices = NULL;
9218 0 : PyObject *__pyx_v_obj = NULL;
9219 0 : int __pyx_r;
9220 : __Pyx_RefNannyDeclarations
9221 0 : PyObject *__pyx_t_1 = NULL;
9222 0 : PyObject *__pyx_t_2 = NULL;
9223 0 : PyObject *__pyx_t_3 = NULL;
9224 0 : int __pyx_t_4;
9225 0 : int __pyx_lineno = 0;
9226 0 : const char *__pyx_filename = NULL;
9227 0 : int __pyx_clineno = 0;
9228 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
9229 0 : __Pyx_INCREF(__pyx_v_index);
9230 :
9231 : /* "View.MemoryView":421
9232 : *
9233 : * def __setitem__(memoryview self, object index, object value):
9234 : * if self.view.readonly: # <<<<<<<<<<<<<<
9235 : * raise TypeError, "Cannot assign to read-only memoryview"
9236 : *
9237 : */
9238 0 : if (unlikely(__pyx_v_self->view.readonly)) {
9239 :
9240 : /* "View.MemoryView":422
9241 : * def __setitem__(memoryview self, object index, object value):
9242 : * if self.view.readonly:
9243 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
9244 : *
9245 : * have_slices, index = _unellipsify(index, self.view.ndim)
9246 : */
9247 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
9248 0 : __PYX_ERR(1, 422, __pyx_L1_error)
9249 :
9250 : /* "View.MemoryView":421
9251 : *
9252 : * def __setitem__(memoryview self, object index, object value):
9253 : * if self.view.readonly: # <<<<<<<<<<<<<<
9254 : * raise TypeError, "Cannot assign to read-only memoryview"
9255 : *
9256 : */
9257 : }
9258 :
9259 : /* "View.MemoryView":424
9260 : * raise TypeError, "Cannot assign to read-only memoryview"
9261 : *
9262 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9263 : *
9264 : * if have_slices:
9265 : */
9266 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
9267 0 : __Pyx_GOTREF(__pyx_t_1);
9268 0 : if (likely(__pyx_t_1 != Py_None)) {
9269 0 : PyObject* sequence = __pyx_t_1;
9270 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9271 0 : if (unlikely(size != 2)) {
9272 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9273 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9274 0 : __PYX_ERR(1, 424, __pyx_L1_error)
9275 : }
9276 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9277 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
9278 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
9279 0 : __Pyx_INCREF(__pyx_t_2);
9280 0 : __Pyx_INCREF(__pyx_t_3);
9281 : #else
9282 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
9283 : __Pyx_GOTREF(__pyx_t_2);
9284 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
9285 : __Pyx_GOTREF(__pyx_t_3);
9286 : #endif
9287 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9288 : } else {
9289 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
9290 : }
9291 0 : __pyx_v_have_slices = __pyx_t_2;
9292 0 : __pyx_t_2 = 0;
9293 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
9294 0 : __pyx_t_3 = 0;
9295 :
9296 : /* "View.MemoryView":426
9297 : * have_slices, index = _unellipsify(index, self.view.ndim)
9298 : *
9299 : * if have_slices: # <<<<<<<<<<<<<<
9300 : * obj = self.is_slice(value)
9301 : * if obj is not None:
9302 : */
9303 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
9304 0 : if (__pyx_t_4) {
9305 :
9306 : /* "View.MemoryView":427
9307 : *
9308 : * if have_slices:
9309 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
9310 : * if obj is not None:
9311 : * self.setitem_slice_assignment(self[index], obj)
9312 : */
9313 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
9314 0 : __Pyx_GOTREF(__pyx_t_1);
9315 0 : __pyx_v_obj = __pyx_t_1;
9316 0 : __pyx_t_1 = 0;
9317 :
9318 : /* "View.MemoryView":428
9319 : * if have_slices:
9320 : * obj = self.is_slice(value)
9321 : * if obj is not None: # <<<<<<<<<<<<<<
9322 : * self.setitem_slice_assignment(self[index], obj)
9323 : * else:
9324 : */
9325 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
9326 0 : if (__pyx_t_4) {
9327 :
9328 : /* "View.MemoryView":429
9329 : * obj = self.is_slice(value)
9330 : * if obj is not None:
9331 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
9332 : * else:
9333 : * self.setitem_slice_assign_scalar(self[index], value)
9334 : */
9335 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
9336 0 : __Pyx_GOTREF(__pyx_t_1);
9337 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
9338 0 : __Pyx_GOTREF(__pyx_t_3);
9339 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9340 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9341 :
9342 : /* "View.MemoryView":428
9343 : * if have_slices:
9344 : * obj = self.is_slice(value)
9345 : * if obj is not None: # <<<<<<<<<<<<<<
9346 : * self.setitem_slice_assignment(self[index], obj)
9347 : * else:
9348 : */
9349 0 : goto __pyx_L5;
9350 : }
9351 :
9352 : /* "View.MemoryView":431
9353 : * self.setitem_slice_assignment(self[index], obj)
9354 : * else:
9355 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
9356 : * else:
9357 : * self.setitem_indexed(index, value)
9358 : */
9359 0 : /*else*/ {
9360 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
9361 0 : __Pyx_GOTREF(__pyx_t_3);
9362 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
9363 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
9364 0 : __Pyx_GOTREF(__pyx_t_1);
9365 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9366 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9367 : }
9368 0 : __pyx_L5:;
9369 :
9370 : /* "View.MemoryView":426
9371 : * have_slices, index = _unellipsify(index, self.view.ndim)
9372 : *
9373 : * if have_slices: # <<<<<<<<<<<<<<
9374 : * obj = self.is_slice(value)
9375 : * if obj is not None:
9376 : */
9377 0 : goto __pyx_L4;
9378 : }
9379 :
9380 : /* "View.MemoryView":433
9381 : * self.setitem_slice_assign_scalar(self[index], value)
9382 : * else:
9383 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
9384 : *
9385 : * cdef is_slice(self, obj):
9386 : */
9387 0 : /*else*/ {
9388 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
9389 0 : __Pyx_GOTREF(__pyx_t_1);
9390 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9391 : }
9392 0 : __pyx_L4:;
9393 :
9394 : /* "View.MemoryView":420
9395 : * return self.convert_item_to_object(itemp)
9396 : *
9397 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9398 : * if self.view.readonly:
9399 : * raise TypeError, "Cannot assign to read-only memoryview"
9400 : */
9401 :
9402 : /* function exit code */
9403 0 : __pyx_r = 0;
9404 0 : goto __pyx_L0;
9405 0 : __pyx_L1_error:;
9406 0 : __Pyx_XDECREF(__pyx_t_1);
9407 0 : __Pyx_XDECREF(__pyx_t_2);
9408 0 : __Pyx_XDECREF(__pyx_t_3);
9409 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9410 0 : __pyx_r = -1;
9411 0 : __pyx_L0:;
9412 0 : __Pyx_XDECREF(__pyx_v_have_slices);
9413 0 : __Pyx_XDECREF(__pyx_v_obj);
9414 0 : __Pyx_XDECREF(__pyx_v_index);
9415 0 : __Pyx_RefNannyFinishContext();
9416 0 : return __pyx_r;
9417 : }
9418 :
9419 : /* "View.MemoryView":435
9420 : * self.setitem_indexed(index, value)
9421 : *
9422 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9423 : * if not isinstance(obj, memoryview):
9424 : * try:
9425 : */
9426 :
9427 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9428 0 : PyObject *__pyx_r = NULL;
9429 : __Pyx_RefNannyDeclarations
9430 0 : int __pyx_t_1;
9431 0 : int __pyx_t_2;
9432 0 : PyObject *__pyx_t_3 = NULL;
9433 0 : PyObject *__pyx_t_4 = NULL;
9434 0 : PyObject *__pyx_t_5 = NULL;
9435 0 : PyObject *__pyx_t_6 = NULL;
9436 0 : PyObject *__pyx_t_7 = NULL;
9437 0 : PyObject *__pyx_t_8 = NULL;
9438 0 : int __pyx_t_9;
9439 0 : int __pyx_lineno = 0;
9440 0 : const char *__pyx_filename = NULL;
9441 0 : int __pyx_clineno = 0;
9442 0 : __Pyx_RefNannySetupContext("is_slice", 0);
9443 0 : __Pyx_INCREF(__pyx_v_obj);
9444 :
9445 : /* "View.MemoryView":436
9446 : *
9447 : * cdef is_slice(self, obj):
9448 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9449 : * try:
9450 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9451 : */
9452 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9453 0 : __pyx_t_2 = (!__pyx_t_1);
9454 0 : if (__pyx_t_2) {
9455 :
9456 : /* "View.MemoryView":437
9457 : * cdef is_slice(self, obj):
9458 : * if not isinstance(obj, memoryview):
9459 : * try: # <<<<<<<<<<<<<<
9460 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9461 : * self.dtype_is_object)
9462 : */
9463 0 : {
9464 0 : __Pyx_PyThreadState_declare
9465 0 : __Pyx_PyThreadState_assign
9466 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9467 0 : __Pyx_XGOTREF(__pyx_t_3);
9468 0 : __Pyx_XGOTREF(__pyx_t_4);
9469 0 : __Pyx_XGOTREF(__pyx_t_5);
9470 0 : /*try:*/ {
9471 :
9472 : /* "View.MemoryView":438
9473 : * if not isinstance(obj, memoryview):
9474 : * try:
9475 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9476 : * self.dtype_is_object)
9477 : * except TypeError:
9478 : */
9479 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
9480 0 : __Pyx_GOTREF(__pyx_t_6);
9481 :
9482 : /* "View.MemoryView":439
9483 : * try:
9484 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9485 : * self.dtype_is_object) # <<<<<<<<<<<<<<
9486 : * except TypeError:
9487 : * return None
9488 : */
9489 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
9490 0 : __Pyx_GOTREF(__pyx_t_7);
9491 :
9492 : /* "View.MemoryView":438
9493 : * if not isinstance(obj, memoryview):
9494 : * try:
9495 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9496 : * self.dtype_is_object)
9497 : * except TypeError:
9498 : */
9499 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
9500 0 : __Pyx_GOTREF(__pyx_t_8);
9501 0 : __Pyx_INCREF(__pyx_v_obj);
9502 0 : __Pyx_GIVEREF(__pyx_v_obj);
9503 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
9504 0 : __Pyx_GIVEREF(__pyx_t_6);
9505 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
9506 0 : __Pyx_GIVEREF(__pyx_t_7);
9507 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
9508 0 : __pyx_t_6 = 0;
9509 0 : __pyx_t_7 = 0;
9510 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
9511 0 : __Pyx_GOTREF(__pyx_t_7);
9512 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9513 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9514 0 : __pyx_t_7 = 0;
9515 :
9516 : /* "View.MemoryView":437
9517 : * cdef is_slice(self, obj):
9518 : * if not isinstance(obj, memoryview):
9519 : * try: # <<<<<<<<<<<<<<
9520 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9521 : * self.dtype_is_object)
9522 : */
9523 : }
9524 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9525 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9526 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9527 0 : goto __pyx_L9_try_end;
9528 0 : __pyx_L4_error:;
9529 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9530 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9531 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9532 :
9533 : /* "View.MemoryView":440
9534 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9535 : * self.dtype_is_object)
9536 : * except TypeError: # <<<<<<<<<<<<<<
9537 : * return None
9538 : *
9539 : */
9540 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9541 0 : if (__pyx_t_9) {
9542 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9543 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
9544 0 : __Pyx_XGOTREF(__pyx_t_7);
9545 0 : __Pyx_XGOTREF(__pyx_t_8);
9546 0 : __Pyx_XGOTREF(__pyx_t_6);
9547 :
9548 : /* "View.MemoryView":441
9549 : * self.dtype_is_object)
9550 : * except TypeError:
9551 : * return None # <<<<<<<<<<<<<<
9552 : *
9553 : * return obj
9554 : */
9555 0 : __Pyx_XDECREF(__pyx_r);
9556 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9557 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9558 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9559 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9560 0 : goto __pyx_L7_except_return;
9561 : }
9562 0 : goto __pyx_L6_except_error;
9563 :
9564 : /* "View.MemoryView":437
9565 : * cdef is_slice(self, obj):
9566 : * if not isinstance(obj, memoryview):
9567 : * try: # <<<<<<<<<<<<<<
9568 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9569 : * self.dtype_is_object)
9570 : */
9571 0 : __pyx_L6_except_error:;
9572 0 : __Pyx_XGIVEREF(__pyx_t_3);
9573 0 : __Pyx_XGIVEREF(__pyx_t_4);
9574 0 : __Pyx_XGIVEREF(__pyx_t_5);
9575 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9576 0 : goto __pyx_L1_error;
9577 0 : __pyx_L7_except_return:;
9578 0 : __Pyx_XGIVEREF(__pyx_t_3);
9579 0 : __Pyx_XGIVEREF(__pyx_t_4);
9580 0 : __Pyx_XGIVEREF(__pyx_t_5);
9581 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9582 0 : goto __pyx_L0;
9583 0 : __pyx_L9_try_end:;
9584 : }
9585 :
9586 : /* "View.MemoryView":436
9587 : *
9588 : * cdef is_slice(self, obj):
9589 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9590 : * try:
9591 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9592 : */
9593 : }
9594 :
9595 : /* "View.MemoryView":443
9596 : * return None
9597 : *
9598 : * return obj # <<<<<<<<<<<<<<
9599 : *
9600 : * cdef setitem_slice_assignment(self, dst, src):
9601 : */
9602 0 : __Pyx_XDECREF(__pyx_r);
9603 0 : __Pyx_INCREF(__pyx_v_obj);
9604 0 : __pyx_r = __pyx_v_obj;
9605 0 : goto __pyx_L0;
9606 :
9607 : /* "View.MemoryView":435
9608 : * self.setitem_indexed(index, value)
9609 : *
9610 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9611 : * if not isinstance(obj, memoryview):
9612 : * try:
9613 : */
9614 :
9615 : /* function exit code */
9616 0 : __pyx_L1_error:;
9617 0 : __Pyx_XDECREF(__pyx_t_6);
9618 0 : __Pyx_XDECREF(__pyx_t_7);
9619 0 : __Pyx_XDECREF(__pyx_t_8);
9620 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9621 : __pyx_r = 0;
9622 0 : __pyx_L0:;
9623 0 : __Pyx_XDECREF(__pyx_v_obj);
9624 0 : __Pyx_XGIVEREF(__pyx_r);
9625 0 : __Pyx_RefNannyFinishContext();
9626 0 : return __pyx_r;
9627 : }
9628 :
9629 : /* "View.MemoryView":445
9630 : * return obj
9631 : *
9632 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9633 : * cdef __Pyx_memviewslice dst_slice
9634 : * cdef __Pyx_memviewslice src_slice
9635 : */
9636 :
9637 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9638 0 : __Pyx_memviewslice __pyx_v_dst_slice;
9639 0 : __Pyx_memviewslice __pyx_v_src_slice;
9640 0 : __Pyx_memviewslice __pyx_v_msrc;
9641 0 : __Pyx_memviewslice __pyx_v_mdst;
9642 0 : PyObject *__pyx_r = NULL;
9643 : __Pyx_RefNannyDeclarations
9644 0 : __Pyx_memviewslice *__pyx_t_1;
9645 0 : PyObject *__pyx_t_2 = NULL;
9646 0 : int __pyx_t_3;
9647 0 : int __pyx_t_4;
9648 0 : int __pyx_t_5;
9649 0 : int __pyx_lineno = 0;
9650 0 : const char *__pyx_filename = NULL;
9651 0 : int __pyx_clineno = 0;
9652 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
9653 :
9654 : /* "View.MemoryView":448
9655 : * cdef __Pyx_memviewslice dst_slice
9656 : * cdef __Pyx_memviewslice src_slice
9657 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9658 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9659 : *
9660 : */
9661 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
9662 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
9663 0 : __pyx_v_msrc = (__pyx_t_1[0]);
9664 :
9665 : /* "View.MemoryView":449
9666 : * cdef __Pyx_memviewslice src_slice
9667 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9668 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9669 : *
9670 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9671 : */
9672 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
9673 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
9674 0 : __pyx_v_mdst = (__pyx_t_1[0]);
9675 :
9676 : /* "View.MemoryView":451
9677 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9678 : *
9679 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9680 : *
9681 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9682 : */
9683 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9684 0 : __Pyx_GOTREF(__pyx_t_2);
9685 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9686 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9687 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9688 0 : __Pyx_GOTREF(__pyx_t_2);
9689 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9690 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9691 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
9692 :
9693 : /* "View.MemoryView":445
9694 : * return obj
9695 : *
9696 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9697 : * cdef __Pyx_memviewslice dst_slice
9698 : * cdef __Pyx_memviewslice src_slice
9699 : */
9700 :
9701 : /* function exit code */
9702 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9703 0 : goto __pyx_L0;
9704 0 : __pyx_L1_error:;
9705 0 : __Pyx_XDECREF(__pyx_t_2);
9706 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9707 : __pyx_r = 0;
9708 0 : __pyx_L0:;
9709 0 : __Pyx_XGIVEREF(__pyx_r);
9710 0 : __Pyx_RefNannyFinishContext();
9711 0 : return __pyx_r;
9712 : }
9713 :
9714 : /* "View.MemoryView":453
9715 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9716 : *
9717 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9718 : * cdef int array[128]
9719 : * cdef void *tmp = NULL
9720 : */
9721 :
9722 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9723 0 : int __pyx_v_array[0x80];
9724 0 : void *__pyx_v_tmp;
9725 0 : void *__pyx_v_item;
9726 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
9727 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
9728 0 : PyObject *__pyx_r = NULL;
9729 : __Pyx_RefNannyDeclarations
9730 0 : __Pyx_memviewslice *__pyx_t_1;
9731 0 : int __pyx_t_2;
9732 0 : PyObject *__pyx_t_3 = NULL;
9733 0 : int __pyx_t_4;
9734 0 : int __pyx_t_5;
9735 0 : char const *__pyx_t_6;
9736 0 : PyObject *__pyx_t_7 = NULL;
9737 0 : PyObject *__pyx_t_8 = NULL;
9738 0 : PyObject *__pyx_t_9 = NULL;
9739 0 : PyObject *__pyx_t_10 = NULL;
9740 0 : PyObject *__pyx_t_11 = NULL;
9741 0 : PyObject *__pyx_t_12 = NULL;
9742 0 : int __pyx_lineno = 0;
9743 0 : const char *__pyx_filename = NULL;
9744 0 : int __pyx_clineno = 0;
9745 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
9746 :
9747 : /* "View.MemoryView":455
9748 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9749 : * cdef int array[128]
9750 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9751 : * cdef void *item
9752 : *
9753 : */
9754 0 : __pyx_v_tmp = NULL;
9755 :
9756 : /* "View.MemoryView":460
9757 : * cdef __Pyx_memviewslice *dst_slice
9758 : * cdef __Pyx_memviewslice tmp_slice
9759 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9760 : *
9761 : * if <size_t>self.view.itemsize > sizeof(array):
9762 : */
9763 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
9764 0 : __pyx_v_dst_slice = __pyx_t_1;
9765 :
9766 : /* "View.MemoryView":462
9767 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9768 : *
9769 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9770 : * tmp = PyMem_Malloc(self.view.itemsize)
9771 : * if tmp == NULL:
9772 : */
9773 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9774 0 : if (__pyx_t_2) {
9775 :
9776 : /* "View.MemoryView":463
9777 : *
9778 : * if <size_t>self.view.itemsize > sizeof(array):
9779 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
9780 : * if tmp == NULL:
9781 : * raise MemoryError
9782 : */
9783 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9784 :
9785 : /* "View.MemoryView":464
9786 : * if <size_t>self.view.itemsize > sizeof(array):
9787 : * tmp = PyMem_Malloc(self.view.itemsize)
9788 : * if tmp == NULL: # <<<<<<<<<<<<<<
9789 : * raise MemoryError
9790 : * item = tmp
9791 : */
9792 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
9793 0 : if (unlikely(__pyx_t_2)) {
9794 :
9795 : /* "View.MemoryView":465
9796 : * tmp = PyMem_Malloc(self.view.itemsize)
9797 : * if tmp == NULL:
9798 : * raise MemoryError # <<<<<<<<<<<<<<
9799 : * item = tmp
9800 : * else:
9801 : */
9802 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
9803 :
9804 : /* "View.MemoryView":464
9805 : * if <size_t>self.view.itemsize > sizeof(array):
9806 : * tmp = PyMem_Malloc(self.view.itemsize)
9807 : * if tmp == NULL: # <<<<<<<<<<<<<<
9808 : * raise MemoryError
9809 : * item = tmp
9810 : */
9811 : }
9812 :
9813 : /* "View.MemoryView":466
9814 : * if tmp == NULL:
9815 : * raise MemoryError
9816 : * item = tmp # <<<<<<<<<<<<<<
9817 : * else:
9818 : * item = <void *> array
9819 : */
9820 0 : __pyx_v_item = __pyx_v_tmp;
9821 :
9822 : /* "View.MemoryView":462
9823 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9824 : *
9825 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9826 : * tmp = PyMem_Malloc(self.view.itemsize)
9827 : * if tmp == NULL:
9828 : */
9829 0 : goto __pyx_L3;
9830 : }
9831 :
9832 : /* "View.MemoryView":468
9833 : * item = tmp
9834 : * else:
9835 : * item = <void *> array # <<<<<<<<<<<<<<
9836 : *
9837 : * try:
9838 : */
9839 : /*else*/ {
9840 : __pyx_v_item = ((void *)__pyx_v_array);
9841 : }
9842 0 : __pyx_L3:;
9843 :
9844 : /* "View.MemoryView":470
9845 : * item = <void *> array
9846 : *
9847 : * try: # <<<<<<<<<<<<<<
9848 : * if self.dtype_is_object:
9849 : * (<PyObject **> item)[0] = <PyObject *> value
9850 : */
9851 0 : /*try:*/ {
9852 :
9853 : /* "View.MemoryView":471
9854 : *
9855 : * try:
9856 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9857 : * (<PyObject **> item)[0] = <PyObject *> value
9858 : * else:
9859 : */
9860 0 : if (__pyx_v_self->dtype_is_object) {
9861 :
9862 : /* "View.MemoryView":472
9863 : * try:
9864 : * if self.dtype_is_object:
9865 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9866 : * else:
9867 : * self.assign_item_from_object(<char *> item, value)
9868 : */
9869 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9870 :
9871 : /* "View.MemoryView":471
9872 : *
9873 : * try:
9874 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9875 : * (<PyObject **> item)[0] = <PyObject *> value
9876 : * else:
9877 : */
9878 0 : goto __pyx_L8;
9879 : }
9880 :
9881 : /* "View.MemoryView":474
9882 : * (<PyObject **> item)[0] = <PyObject *> value
9883 : * else:
9884 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9885 : *
9886 : *
9887 : */
9888 0 : /*else*/ {
9889 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
9890 0 : __Pyx_GOTREF(__pyx_t_3);
9891 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9892 : }
9893 0 : __pyx_L8:;
9894 :
9895 : /* "View.MemoryView":478
9896 : *
9897 : *
9898 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9899 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9900 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9901 : */
9902 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9903 0 : if (__pyx_t_2) {
9904 :
9905 : /* "View.MemoryView":479
9906 : *
9907 : * if self.view.suboffsets != NULL:
9908 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9909 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9910 : * item, self.dtype_is_object)
9911 : */
9912 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
9913 :
9914 : /* "View.MemoryView":478
9915 : *
9916 : *
9917 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9918 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9919 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9920 : */
9921 : }
9922 :
9923 : /* "View.MemoryView":480
9924 : * if self.view.suboffsets != NULL:
9925 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9926 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
9927 : * item, self.dtype_is_object)
9928 : * finally:
9929 : */
9930 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
9931 : }
9932 :
9933 : /* "View.MemoryView":483
9934 : * item, self.dtype_is_object)
9935 : * finally:
9936 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9937 : *
9938 : * cdef setitem_indexed(self, index, value):
9939 : */
9940 0 : /*finally:*/ {
9941 0 : /*normal exit:*/{
9942 0 : PyMem_Free(__pyx_v_tmp);
9943 0 : goto __pyx_L7;
9944 : }
9945 0 : __pyx_L6_error:;
9946 0 : /*exception exit:*/{
9947 0 : __Pyx_PyThreadState_declare
9948 0 : __Pyx_PyThreadState_assign
9949 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9950 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9951 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9952 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9953 0 : __Pyx_XGOTREF(__pyx_t_7);
9954 0 : __Pyx_XGOTREF(__pyx_t_8);
9955 0 : __Pyx_XGOTREF(__pyx_t_9);
9956 0 : __Pyx_XGOTREF(__pyx_t_10);
9957 0 : __Pyx_XGOTREF(__pyx_t_11);
9958 0 : __Pyx_XGOTREF(__pyx_t_12);
9959 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9960 0 : {
9961 0 : PyMem_Free(__pyx_v_tmp);
9962 : }
9963 0 : if (PY_MAJOR_VERSION >= 3) {
9964 0 : __Pyx_XGIVEREF(__pyx_t_10);
9965 0 : __Pyx_XGIVEREF(__pyx_t_11);
9966 0 : __Pyx_XGIVEREF(__pyx_t_12);
9967 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9968 : }
9969 0 : __Pyx_XGIVEREF(__pyx_t_7);
9970 0 : __Pyx_XGIVEREF(__pyx_t_8);
9971 0 : __Pyx_XGIVEREF(__pyx_t_9);
9972 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9973 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9974 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9975 0 : goto __pyx_L1_error;
9976 : }
9977 0 : __pyx_L7:;
9978 : }
9979 :
9980 : /* "View.MemoryView":453
9981 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9982 : *
9983 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9984 : * cdef int array[128]
9985 : * cdef void *tmp = NULL
9986 : */
9987 :
9988 : /* function exit code */
9989 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9990 0 : goto __pyx_L0;
9991 0 : __pyx_L1_error:;
9992 0 : __Pyx_XDECREF(__pyx_t_3);
9993 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9994 : __pyx_r = 0;
9995 0 : __pyx_L0:;
9996 0 : __Pyx_XGIVEREF(__pyx_r);
9997 0 : __Pyx_RefNannyFinishContext();
9998 0 : return __pyx_r;
9999 : }
10000 :
10001 : /* "View.MemoryView":485
10002 : * PyMem_Free(tmp)
10003 : *
10004 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10005 : * cdef char *itemp = self.get_item_pointer(index)
10006 : * self.assign_item_from_object(itemp, value)
10007 : */
10008 :
10009 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10010 0 : char *__pyx_v_itemp;
10011 0 : PyObject *__pyx_r = NULL;
10012 : __Pyx_RefNannyDeclarations
10013 0 : char *__pyx_t_1;
10014 0 : PyObject *__pyx_t_2 = NULL;
10015 0 : int __pyx_lineno = 0;
10016 0 : const char *__pyx_filename = NULL;
10017 0 : int __pyx_clineno = 0;
10018 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
10019 :
10020 : /* "View.MemoryView":486
10021 : *
10022 : * cdef setitem_indexed(self, index, value):
10023 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
10024 : * self.assign_item_from_object(itemp, value)
10025 : *
10026 : */
10027 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
10028 0 : __pyx_v_itemp = __pyx_t_1;
10029 :
10030 : /* "View.MemoryView":487
10031 : * cdef setitem_indexed(self, index, value):
10032 : * cdef char *itemp = self.get_item_pointer(index)
10033 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
10034 : *
10035 : * cdef convert_item_to_object(self, char *itemp):
10036 : */
10037 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
10038 0 : __Pyx_GOTREF(__pyx_t_2);
10039 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10040 :
10041 : /* "View.MemoryView":485
10042 : * PyMem_Free(tmp)
10043 : *
10044 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10045 : * cdef char *itemp = self.get_item_pointer(index)
10046 : * self.assign_item_from_object(itemp, value)
10047 : */
10048 :
10049 : /* function exit code */
10050 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10051 0 : goto __pyx_L0;
10052 0 : __pyx_L1_error:;
10053 0 : __Pyx_XDECREF(__pyx_t_2);
10054 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10055 0 : __pyx_r = 0;
10056 0 : __pyx_L0:;
10057 0 : __Pyx_XGIVEREF(__pyx_r);
10058 0 : __Pyx_RefNannyFinishContext();
10059 0 : return __pyx_r;
10060 : }
10061 :
10062 : /* "View.MemoryView":489
10063 : * self.assign_item_from_object(itemp, value)
10064 : *
10065 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10066 : * """Only used if instantiated manually by the user, or if Cython doesn't
10067 : * know how to convert the type"""
10068 : */
10069 :
10070 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10071 0 : PyObject *__pyx_v_struct = NULL;
10072 0 : PyObject *__pyx_v_bytesitem = 0;
10073 0 : PyObject *__pyx_v_result = NULL;
10074 0 : PyObject *__pyx_r = NULL;
10075 : __Pyx_RefNannyDeclarations
10076 0 : PyObject *__pyx_t_1 = NULL;
10077 0 : PyObject *__pyx_t_2 = NULL;
10078 0 : PyObject *__pyx_t_3 = NULL;
10079 0 : PyObject *__pyx_t_4 = NULL;
10080 0 : PyObject *__pyx_t_5 = NULL;
10081 0 : PyObject *__pyx_t_6 = NULL;
10082 0 : PyObject *__pyx_t_7 = NULL;
10083 0 : unsigned int __pyx_t_8;
10084 0 : Py_ssize_t __pyx_t_9;
10085 0 : int __pyx_t_10;
10086 0 : int __pyx_t_11;
10087 0 : int __pyx_lineno = 0;
10088 0 : const char *__pyx_filename = NULL;
10089 0 : int __pyx_clineno = 0;
10090 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
10091 :
10092 : /* "View.MemoryView":492
10093 : * """Only used if instantiated manually by the user, or if Cython doesn't
10094 : * know how to convert the type"""
10095 : * import struct # <<<<<<<<<<<<<<
10096 : * cdef bytes bytesitem
10097 : *
10098 : */
10099 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
10100 0 : __Pyx_GOTREF(__pyx_t_1);
10101 0 : __pyx_v_struct = __pyx_t_1;
10102 0 : __pyx_t_1 = 0;
10103 :
10104 : /* "View.MemoryView":495
10105 : * cdef bytes bytesitem
10106 : *
10107 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10108 : * try:
10109 : * result = struct.unpack(self.view.format, bytesitem)
10110 : */
10111 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
10112 0 : __Pyx_GOTREF(__pyx_t_1);
10113 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10114 0 : __pyx_t_1 = 0;
10115 :
10116 : /* "View.MemoryView":496
10117 : *
10118 : * bytesitem = itemp[:self.view.itemsize]
10119 : * try: # <<<<<<<<<<<<<<
10120 : * result = struct.unpack(self.view.format, bytesitem)
10121 : * except struct.error:
10122 : */
10123 0 : {
10124 0 : __Pyx_PyThreadState_declare
10125 0 : __Pyx_PyThreadState_assign
10126 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10127 0 : __Pyx_XGOTREF(__pyx_t_2);
10128 0 : __Pyx_XGOTREF(__pyx_t_3);
10129 0 : __Pyx_XGOTREF(__pyx_t_4);
10130 0 : /*try:*/ {
10131 :
10132 : /* "View.MemoryView":497
10133 : * bytesitem = itemp[:self.view.itemsize]
10134 : * try:
10135 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10136 : * except struct.error:
10137 : * raise ValueError, "Unable to convert item to object"
10138 : */
10139 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
10140 0 : __Pyx_GOTREF(__pyx_t_5);
10141 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
10142 0 : __Pyx_GOTREF(__pyx_t_6);
10143 0 : __pyx_t_7 = NULL;
10144 0 : __pyx_t_8 = 0;
10145 : #if CYTHON_UNPACK_METHODS
10146 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
10147 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10148 0 : if (likely(__pyx_t_7)) {
10149 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10150 0 : __Pyx_INCREF(__pyx_t_7);
10151 0 : __Pyx_INCREF(function);
10152 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
10153 : __pyx_t_8 = 1;
10154 : }
10155 : }
10156 : #endif
10157 0 : {
10158 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10159 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
10160 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10161 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10162 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
10163 0 : __Pyx_GOTREF(__pyx_t_1);
10164 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10165 : }
10166 0 : __pyx_v_result = __pyx_t_1;
10167 0 : __pyx_t_1 = 0;
10168 :
10169 : /* "View.MemoryView":496
10170 : *
10171 : * bytesitem = itemp[:self.view.itemsize]
10172 : * try: # <<<<<<<<<<<<<<
10173 : * result = struct.unpack(self.view.format, bytesitem)
10174 : * except struct.error:
10175 : */
10176 : }
10177 :
10178 : /* "View.MemoryView":501
10179 : * raise ValueError, "Unable to convert item to object"
10180 : * else:
10181 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10182 : * return result[0]
10183 : * return result
10184 : */
10185 0 : /*else:*/ {
10186 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
10187 0 : __pyx_t_10 = (__pyx_t_9 == 1);
10188 0 : if (__pyx_t_10) {
10189 :
10190 : /* "View.MemoryView":502
10191 : * else:
10192 : * if len(self.view.format) == 1:
10193 : * return result[0] # <<<<<<<<<<<<<<
10194 : * return result
10195 : *
10196 : */
10197 0 : __Pyx_XDECREF(__pyx_r);
10198 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
10199 0 : __Pyx_GOTREF(__pyx_t_1);
10200 0 : __pyx_r = __pyx_t_1;
10201 0 : __pyx_t_1 = 0;
10202 0 : goto __pyx_L6_except_return;
10203 :
10204 : /* "View.MemoryView":501
10205 : * raise ValueError, "Unable to convert item to object"
10206 : * else:
10207 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10208 : * return result[0]
10209 : * return result
10210 : */
10211 : }
10212 :
10213 : /* "View.MemoryView":503
10214 : * if len(self.view.format) == 1:
10215 : * return result[0]
10216 : * return result # <<<<<<<<<<<<<<
10217 : *
10218 : * cdef assign_item_from_object(self, char *itemp, object value):
10219 : */
10220 0 : __Pyx_XDECREF(__pyx_r);
10221 0 : __Pyx_INCREF(__pyx_v_result);
10222 0 : __pyx_r = __pyx_v_result;
10223 0 : goto __pyx_L6_except_return;
10224 : }
10225 0 : __pyx_L3_error:;
10226 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10227 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10228 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10229 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10230 :
10231 : /* "View.MemoryView":498
10232 : * try:
10233 : * result = struct.unpack(self.view.format, bytesitem)
10234 : * except struct.error: # <<<<<<<<<<<<<<
10235 : * raise ValueError, "Unable to convert item to object"
10236 : * else:
10237 : */
10238 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
10239 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
10240 0 : __Pyx_GOTREF(__pyx_t_7);
10241 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
10242 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10243 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
10244 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
10245 0 : if (__pyx_t_11) {
10246 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10247 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
10248 0 : __Pyx_XGOTREF(__pyx_t_6);
10249 0 : __Pyx_XGOTREF(__pyx_t_5);
10250 0 : __Pyx_XGOTREF(__pyx_t_1);
10251 :
10252 : /* "View.MemoryView":499
10253 : * result = struct.unpack(self.view.format, bytesitem)
10254 : * except struct.error:
10255 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
10256 : * else:
10257 : * if len(self.view.format) == 1:
10258 : */
10259 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
10260 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
10261 : }
10262 0 : goto __pyx_L5_except_error;
10263 :
10264 : /* "View.MemoryView":496
10265 : *
10266 : * bytesitem = itemp[:self.view.itemsize]
10267 : * try: # <<<<<<<<<<<<<<
10268 : * result = struct.unpack(self.view.format, bytesitem)
10269 : * except struct.error:
10270 : */
10271 0 : __pyx_L5_except_error:;
10272 0 : __Pyx_XGIVEREF(__pyx_t_2);
10273 0 : __Pyx_XGIVEREF(__pyx_t_3);
10274 0 : __Pyx_XGIVEREF(__pyx_t_4);
10275 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10276 0 : goto __pyx_L1_error;
10277 0 : __pyx_L6_except_return:;
10278 0 : __Pyx_XGIVEREF(__pyx_t_2);
10279 0 : __Pyx_XGIVEREF(__pyx_t_3);
10280 0 : __Pyx_XGIVEREF(__pyx_t_4);
10281 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10282 0 : goto __pyx_L0;
10283 : }
10284 :
10285 : /* "View.MemoryView":489
10286 : * self.assign_item_from_object(itemp, value)
10287 : *
10288 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10289 : * """Only used if instantiated manually by the user, or if Cython doesn't
10290 : * know how to convert the type"""
10291 : */
10292 :
10293 : /* function exit code */
10294 0 : __pyx_L1_error:;
10295 0 : __Pyx_XDECREF(__pyx_t_1);
10296 0 : __Pyx_XDECREF(__pyx_t_5);
10297 0 : __Pyx_XDECREF(__pyx_t_6);
10298 0 : __Pyx_XDECREF(__pyx_t_7);
10299 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10300 : __pyx_r = 0;
10301 0 : __pyx_L0:;
10302 0 : __Pyx_XDECREF(__pyx_v_struct);
10303 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
10304 0 : __Pyx_XDECREF(__pyx_v_result);
10305 0 : __Pyx_XGIVEREF(__pyx_r);
10306 0 : __Pyx_RefNannyFinishContext();
10307 0 : return __pyx_r;
10308 : }
10309 :
10310 : /* "View.MemoryView":505
10311 : * return result
10312 : *
10313 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10314 : * """Only used if instantiated manually by the user, or if Cython doesn't
10315 : * know how to convert the type"""
10316 : */
10317 :
10318 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10319 0 : PyObject *__pyx_v_struct = NULL;
10320 0 : char __pyx_v_c;
10321 0 : PyObject *__pyx_v_bytesvalue = 0;
10322 0 : Py_ssize_t __pyx_v_i;
10323 0 : PyObject *__pyx_r = NULL;
10324 : __Pyx_RefNannyDeclarations
10325 0 : PyObject *__pyx_t_1 = NULL;
10326 0 : int __pyx_t_2;
10327 0 : PyObject *__pyx_t_3 = NULL;
10328 0 : PyObject *__pyx_t_4 = NULL;
10329 0 : PyObject *__pyx_t_5 = NULL;
10330 0 : unsigned int __pyx_t_6;
10331 0 : Py_ssize_t __pyx_t_7;
10332 0 : PyObject *__pyx_t_8 = NULL;
10333 0 : char *__pyx_t_9;
10334 0 : char *__pyx_t_10;
10335 0 : char *__pyx_t_11;
10336 0 : char *__pyx_t_12;
10337 0 : int __pyx_lineno = 0;
10338 0 : const char *__pyx_filename = NULL;
10339 0 : int __pyx_clineno = 0;
10340 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
10341 :
10342 : /* "View.MemoryView":508
10343 : * """Only used if instantiated manually by the user, or if Cython doesn't
10344 : * know how to convert the type"""
10345 : * import struct # <<<<<<<<<<<<<<
10346 : * cdef char c
10347 : * cdef bytes bytesvalue
10348 : */
10349 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
10350 0 : __Pyx_GOTREF(__pyx_t_1);
10351 0 : __pyx_v_struct = __pyx_t_1;
10352 0 : __pyx_t_1 = 0;
10353 :
10354 : /* "View.MemoryView":513
10355 : * cdef Py_ssize_t i
10356 : *
10357 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10358 : * bytesvalue = struct.pack(self.view.format, *value)
10359 : * else:
10360 : */
10361 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10362 0 : if (__pyx_t_2) {
10363 :
10364 : /* "View.MemoryView":514
10365 : *
10366 : * if isinstance(value, tuple):
10367 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10368 : * else:
10369 : * bytesvalue = struct.pack(self.view.format, value)
10370 : */
10371 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
10372 0 : __Pyx_GOTREF(__pyx_t_1);
10373 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
10374 0 : __Pyx_GOTREF(__pyx_t_3);
10375 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
10376 0 : __Pyx_GOTREF(__pyx_t_4);
10377 0 : __Pyx_GIVEREF(__pyx_t_3);
10378 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
10379 0 : __pyx_t_3 = 0;
10380 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
10381 0 : __Pyx_GOTREF(__pyx_t_3);
10382 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
10383 0 : __Pyx_GOTREF(__pyx_t_5);
10384 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10385 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10386 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
10387 0 : __Pyx_GOTREF(__pyx_t_3);
10388 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10389 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10390 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
10391 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
10392 0 : __pyx_t_3 = 0;
10393 :
10394 : /* "View.MemoryView":513
10395 : * cdef Py_ssize_t i
10396 : *
10397 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10398 : * bytesvalue = struct.pack(self.view.format, *value)
10399 : * else:
10400 : */
10401 0 : goto __pyx_L3;
10402 : }
10403 :
10404 : /* "View.MemoryView":516
10405 : * bytesvalue = struct.pack(self.view.format, *value)
10406 : * else:
10407 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10408 : *
10409 : * for i, c in enumerate(bytesvalue):
10410 : */
10411 0 : /*else*/ {
10412 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
10413 0 : __Pyx_GOTREF(__pyx_t_5);
10414 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
10415 0 : __Pyx_GOTREF(__pyx_t_1);
10416 0 : __pyx_t_4 = NULL;
10417 0 : __pyx_t_6 = 0;
10418 : #if CYTHON_UNPACK_METHODS
10419 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
10420 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
10421 0 : if (likely(__pyx_t_4)) {
10422 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10423 0 : __Pyx_INCREF(__pyx_t_4);
10424 0 : __Pyx_INCREF(function);
10425 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
10426 : __pyx_t_6 = 1;
10427 : }
10428 : }
10429 : #endif
10430 0 : {
10431 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
10432 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
10433 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10434 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10435 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
10436 0 : __Pyx_GOTREF(__pyx_t_3);
10437 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10438 : }
10439 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
10440 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
10441 : __pyx_t_3 = 0;
10442 : }
10443 0 : __pyx_L3:;
10444 :
10445 : /* "View.MemoryView":518
10446 : * bytesvalue = struct.pack(self.view.format, value)
10447 : *
10448 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10449 : * itemp[i] = c
10450 : *
10451 : */
10452 0 : __pyx_t_7 = 0;
10453 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10454 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
10455 0 : __PYX_ERR(1, 518, __pyx_L1_error)
10456 : }
10457 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
10458 0 : __pyx_t_8 = __pyx_v_bytesvalue;
10459 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
10460 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
10461 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
10462 0 : __pyx_t_9 = __pyx_t_12;
10463 0 : __pyx_v_c = (__pyx_t_9[0]);
10464 :
10465 : /* "View.MemoryView":519
10466 : *
10467 : * for i, c in enumerate(bytesvalue):
10468 : * itemp[i] = c # <<<<<<<<<<<<<<
10469 : *
10470 : * @cname('getbuffer')
10471 : */
10472 0 : __pyx_v_i = __pyx_t_7;
10473 :
10474 : /* "View.MemoryView":518
10475 : * bytesvalue = struct.pack(self.view.format, value)
10476 : *
10477 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10478 : * itemp[i] = c
10479 : *
10480 : */
10481 0 : __pyx_t_7 = (__pyx_t_7 + 1);
10482 :
10483 : /* "View.MemoryView":519
10484 : *
10485 : * for i, c in enumerate(bytesvalue):
10486 : * itemp[i] = c # <<<<<<<<<<<<<<
10487 : *
10488 : * @cname('getbuffer')
10489 : */
10490 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10491 : }
10492 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10493 :
10494 : /* "View.MemoryView":505
10495 : * return result
10496 : *
10497 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10498 : * """Only used if instantiated manually by the user, or if Cython doesn't
10499 : * know how to convert the type"""
10500 : */
10501 :
10502 : /* function exit code */
10503 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10504 0 : goto __pyx_L0;
10505 0 : __pyx_L1_error:;
10506 0 : __Pyx_XDECREF(__pyx_t_1);
10507 0 : __Pyx_XDECREF(__pyx_t_3);
10508 0 : __Pyx_XDECREF(__pyx_t_4);
10509 0 : __Pyx_XDECREF(__pyx_t_5);
10510 0 : __Pyx_XDECREF(__pyx_t_8);
10511 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10512 0 : __pyx_r = 0;
10513 0 : __pyx_L0:;
10514 0 : __Pyx_XDECREF(__pyx_v_struct);
10515 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
10516 0 : __Pyx_XGIVEREF(__pyx_r);
10517 0 : __Pyx_RefNannyFinishContext();
10518 0 : return __pyx_r;
10519 : }
10520 :
10521 : /* "View.MemoryView":521
10522 : * itemp[i] = c
10523 : *
10524 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10525 : * def __getbuffer__(self, Py_buffer *info, int flags):
10526 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10527 : */
10528 :
10529 : /* Python wrapper */
10530 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10531 1398 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10532 1398 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10533 1398 : int __pyx_r;
10534 : __Pyx_RefNannyDeclarations
10535 1398 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10536 1398 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10537 1398 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10538 :
10539 : /* function exit code */
10540 1398 : __Pyx_RefNannyFinishContext();
10541 1398 : return __pyx_r;
10542 : }
10543 :
10544 1398 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10545 1398 : int __pyx_r;
10546 : __Pyx_RefNannyDeclarations
10547 1398 : int __pyx_t_1;
10548 1398 : int __pyx_t_2;
10549 1398 : Py_ssize_t *__pyx_t_3;
10550 1398 : char *__pyx_t_4;
10551 1398 : void *__pyx_t_5;
10552 1398 : int __pyx_t_6;
10553 1398 : Py_ssize_t __pyx_t_7;
10554 1398 : int __pyx_lineno = 0;
10555 1398 : const char *__pyx_filename = NULL;
10556 1398 : int __pyx_clineno = 0;
10557 1398 : if (unlikely(__pyx_v_info == NULL)) {
10558 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10559 0 : return -1;
10560 : }
10561 1398 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
10562 1398 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10563 1398 : __Pyx_GIVEREF(__pyx_v_info->obj);
10564 :
10565 : /* "View.MemoryView":523
10566 : * @cname('getbuffer')
10567 : * def __getbuffer__(self, Py_buffer *info, int flags):
10568 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10569 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10570 : *
10571 : */
10572 1398 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10573 1398 : if (__pyx_t_2) {
10574 : } else {
10575 1398 : __pyx_t_1 = __pyx_t_2;
10576 1398 : goto __pyx_L4_bool_binop_done;
10577 : }
10578 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
10579 1398 : __pyx_L4_bool_binop_done:;
10580 1398 : if (unlikely(__pyx_t_1)) {
10581 :
10582 : /* "View.MemoryView":524
10583 : * def __getbuffer__(self, Py_buffer *info, int flags):
10584 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10585 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
10586 : *
10587 : * if flags & PyBUF_ND:
10588 : */
10589 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
10590 0 : __PYX_ERR(1, 524, __pyx_L1_error)
10591 :
10592 : /* "View.MemoryView":523
10593 : * @cname('getbuffer')
10594 : * def __getbuffer__(self, Py_buffer *info, int flags):
10595 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10596 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10597 : *
10598 : */
10599 : }
10600 :
10601 : /* "View.MemoryView":526
10602 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10603 : *
10604 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10605 : * info.shape = self.view.shape
10606 : * else:
10607 : */
10608 1398 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10609 1398 : if (__pyx_t_1) {
10610 :
10611 : /* "View.MemoryView":527
10612 : *
10613 : * if flags & PyBUF_ND:
10614 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
10615 : * else:
10616 : * info.shape = NULL
10617 : */
10618 1398 : __pyx_t_3 = __pyx_v_self->view.shape;
10619 1398 : __pyx_v_info->shape = __pyx_t_3;
10620 :
10621 : /* "View.MemoryView":526
10622 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10623 : *
10624 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10625 : * info.shape = self.view.shape
10626 : * else:
10627 : */
10628 1398 : goto __pyx_L6;
10629 : }
10630 :
10631 : /* "View.MemoryView":529
10632 : * info.shape = self.view.shape
10633 : * else:
10634 : * info.shape = NULL # <<<<<<<<<<<<<<
10635 : *
10636 : * if flags & PyBUF_STRIDES:
10637 : */
10638 0 : /*else*/ {
10639 0 : __pyx_v_info->shape = NULL;
10640 : }
10641 1398 : __pyx_L6:;
10642 :
10643 : /* "View.MemoryView":531
10644 : * info.shape = NULL
10645 : *
10646 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10647 : * info.strides = self.view.strides
10648 : * else:
10649 : */
10650 1398 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10651 1398 : if (__pyx_t_1) {
10652 :
10653 : /* "View.MemoryView":532
10654 : *
10655 : * if flags & PyBUF_STRIDES:
10656 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
10657 : * else:
10658 : * info.strides = NULL
10659 : */
10660 1398 : __pyx_t_3 = __pyx_v_self->view.strides;
10661 1398 : __pyx_v_info->strides = __pyx_t_3;
10662 :
10663 : /* "View.MemoryView":531
10664 : * info.shape = NULL
10665 : *
10666 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10667 : * info.strides = self.view.strides
10668 : * else:
10669 : */
10670 1398 : goto __pyx_L7;
10671 : }
10672 :
10673 : /* "View.MemoryView":534
10674 : * info.strides = self.view.strides
10675 : * else:
10676 : * info.strides = NULL # <<<<<<<<<<<<<<
10677 : *
10678 : * if flags & PyBUF_INDIRECT:
10679 : */
10680 0 : /*else*/ {
10681 0 : __pyx_v_info->strides = NULL;
10682 : }
10683 1398 : __pyx_L7:;
10684 :
10685 : /* "View.MemoryView":536
10686 : * info.strides = NULL
10687 : *
10688 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10689 : * info.suboffsets = self.view.suboffsets
10690 : * else:
10691 : */
10692 1398 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10693 1398 : if (__pyx_t_1) {
10694 :
10695 : /* "View.MemoryView":537
10696 : *
10697 : * if flags & PyBUF_INDIRECT:
10698 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10699 : * else:
10700 : * info.suboffsets = NULL
10701 : */
10702 1398 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
10703 1398 : __pyx_v_info->suboffsets = __pyx_t_3;
10704 :
10705 : /* "View.MemoryView":536
10706 : * info.strides = NULL
10707 : *
10708 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10709 : * info.suboffsets = self.view.suboffsets
10710 : * else:
10711 : */
10712 1398 : goto __pyx_L8;
10713 : }
10714 :
10715 : /* "View.MemoryView":539
10716 : * info.suboffsets = self.view.suboffsets
10717 : * else:
10718 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
10719 : *
10720 : * if flags & PyBUF_FORMAT:
10721 : */
10722 0 : /*else*/ {
10723 0 : __pyx_v_info->suboffsets = NULL;
10724 : }
10725 1398 : __pyx_L8:;
10726 :
10727 : /* "View.MemoryView":541
10728 : * info.suboffsets = NULL
10729 : *
10730 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10731 : * info.format = self.view.format
10732 : * else:
10733 : */
10734 1398 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10735 1398 : if (__pyx_t_1) {
10736 :
10737 : /* "View.MemoryView":542
10738 : *
10739 : * if flags & PyBUF_FORMAT:
10740 : * info.format = self.view.format # <<<<<<<<<<<<<<
10741 : * else:
10742 : * info.format = NULL
10743 : */
10744 1398 : __pyx_t_4 = __pyx_v_self->view.format;
10745 1398 : __pyx_v_info->format = __pyx_t_4;
10746 :
10747 : /* "View.MemoryView":541
10748 : * info.suboffsets = NULL
10749 : *
10750 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10751 : * info.format = self.view.format
10752 : * else:
10753 : */
10754 1398 : goto __pyx_L9;
10755 : }
10756 :
10757 : /* "View.MemoryView":544
10758 : * info.format = self.view.format
10759 : * else:
10760 : * info.format = NULL # <<<<<<<<<<<<<<
10761 : *
10762 : * info.buf = self.view.buf
10763 : */
10764 0 : /*else*/ {
10765 0 : __pyx_v_info->format = NULL;
10766 : }
10767 1398 : __pyx_L9:;
10768 :
10769 : /* "View.MemoryView":546
10770 : * info.format = NULL
10771 : *
10772 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
10773 : * info.ndim = self.view.ndim
10774 : * info.itemsize = self.view.itemsize
10775 : */
10776 1398 : __pyx_t_5 = __pyx_v_self->view.buf;
10777 1398 : __pyx_v_info->buf = __pyx_t_5;
10778 :
10779 : /* "View.MemoryView":547
10780 : *
10781 : * info.buf = self.view.buf
10782 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10783 : * info.itemsize = self.view.itemsize
10784 : * info.len = self.view.len
10785 : */
10786 1398 : __pyx_t_6 = __pyx_v_self->view.ndim;
10787 1398 : __pyx_v_info->ndim = __pyx_t_6;
10788 :
10789 : /* "View.MemoryView":548
10790 : * info.buf = self.view.buf
10791 : * info.ndim = self.view.ndim
10792 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10793 : * info.len = self.view.len
10794 : * info.readonly = self.view.readonly
10795 : */
10796 1398 : __pyx_t_7 = __pyx_v_self->view.itemsize;
10797 1398 : __pyx_v_info->itemsize = __pyx_t_7;
10798 :
10799 : /* "View.MemoryView":549
10800 : * info.ndim = self.view.ndim
10801 : * info.itemsize = self.view.itemsize
10802 : * info.len = self.view.len # <<<<<<<<<<<<<<
10803 : * info.readonly = self.view.readonly
10804 : * info.obj = self
10805 : */
10806 1398 : __pyx_t_7 = __pyx_v_self->view.len;
10807 1398 : __pyx_v_info->len = __pyx_t_7;
10808 :
10809 : /* "View.MemoryView":550
10810 : * info.itemsize = self.view.itemsize
10811 : * info.len = self.view.len
10812 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10813 : * info.obj = self
10814 : *
10815 : */
10816 1398 : __pyx_t_1 = __pyx_v_self->view.readonly;
10817 1398 : __pyx_v_info->readonly = __pyx_t_1;
10818 :
10819 : /* "View.MemoryView":551
10820 : * info.len = self.view.len
10821 : * info.readonly = self.view.readonly
10822 : * info.obj = self # <<<<<<<<<<<<<<
10823 : *
10824 : *
10825 : */
10826 1398 : __Pyx_INCREF((PyObject *)__pyx_v_self);
10827 1398 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10828 1398 : __Pyx_GOTREF(__pyx_v_info->obj);
10829 1398 : __Pyx_DECREF(__pyx_v_info->obj);
10830 1398 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10831 :
10832 : /* "View.MemoryView":521
10833 : * itemp[i] = c
10834 : *
10835 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10836 : * def __getbuffer__(self, Py_buffer *info, int flags):
10837 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10838 : */
10839 :
10840 : /* function exit code */
10841 1398 : __pyx_r = 0;
10842 1398 : goto __pyx_L0;
10843 0 : __pyx_L1_error:;
10844 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10845 0 : __pyx_r = -1;
10846 0 : if (__pyx_v_info->obj != NULL) {
10847 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10848 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10849 : }
10850 0 : goto __pyx_L2;
10851 1398 : __pyx_L0:;
10852 1398 : if (__pyx_v_info->obj == Py_None) {
10853 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10854 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10855 : }
10856 1398 : __pyx_L2:;
10857 : __Pyx_RefNannyFinishContext();
10858 : return __pyx_r;
10859 : }
10860 :
10861 : /* "View.MemoryView":554
10862 : *
10863 : *
10864 : * @property # <<<<<<<<<<<<<<
10865 : * def T(self):
10866 : * cdef _memoryviewslice result = memoryview_copy(self)
10867 : */
10868 :
10869 : /* Python wrapper */
10870 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10871 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10872 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10873 0 : PyObject *__pyx_r = 0;
10874 : __Pyx_RefNannyDeclarations
10875 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10876 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10877 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10878 :
10879 : /* function exit code */
10880 0 : __Pyx_RefNannyFinishContext();
10881 0 : return __pyx_r;
10882 : }
10883 :
10884 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10885 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10886 0 : PyObject *__pyx_r = NULL;
10887 : __Pyx_RefNannyDeclarations
10888 0 : PyObject *__pyx_t_1 = NULL;
10889 0 : int __pyx_t_2;
10890 0 : int __pyx_lineno = 0;
10891 0 : const char *__pyx_filename = NULL;
10892 0 : int __pyx_clineno = 0;
10893 0 : __Pyx_RefNannySetupContext("__get__", 1);
10894 :
10895 : /* "View.MemoryView":556
10896 : * @property
10897 : * def T(self):
10898 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10899 : * transpose_memslice(&result.from_slice)
10900 : * return result
10901 : */
10902 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
10903 0 : __Pyx_GOTREF(__pyx_t_1);
10904 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
10905 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10906 0 : __pyx_t_1 = 0;
10907 :
10908 : /* "View.MemoryView":557
10909 : * def T(self):
10910 : * cdef _memoryviewslice result = memoryview_copy(self)
10911 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10912 : * return result
10913 : *
10914 : */
10915 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
10916 :
10917 : /* "View.MemoryView":558
10918 : * cdef _memoryviewslice result = memoryview_copy(self)
10919 : * transpose_memslice(&result.from_slice)
10920 : * return result # <<<<<<<<<<<<<<
10921 : *
10922 : * @property
10923 : */
10924 0 : __Pyx_XDECREF(__pyx_r);
10925 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
10926 0 : __pyx_r = ((PyObject *)__pyx_v_result);
10927 0 : goto __pyx_L0;
10928 :
10929 : /* "View.MemoryView":554
10930 : *
10931 : *
10932 : * @property # <<<<<<<<<<<<<<
10933 : * def T(self):
10934 : * cdef _memoryviewslice result = memoryview_copy(self)
10935 : */
10936 :
10937 : /* function exit code */
10938 0 : __pyx_L1_error:;
10939 0 : __Pyx_XDECREF(__pyx_t_1);
10940 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10941 0 : __pyx_r = NULL;
10942 0 : __pyx_L0:;
10943 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
10944 0 : __Pyx_XGIVEREF(__pyx_r);
10945 0 : __Pyx_RefNannyFinishContext();
10946 0 : return __pyx_r;
10947 : }
10948 :
10949 : /* "View.MemoryView":560
10950 : * return result
10951 : *
10952 : * @property # <<<<<<<<<<<<<<
10953 : * def base(self):
10954 : * return self._get_base()
10955 : */
10956 :
10957 : /* Python wrapper */
10958 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10959 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10960 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10961 0 : PyObject *__pyx_r = 0;
10962 : __Pyx_RefNannyDeclarations
10963 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10964 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10965 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10966 :
10967 : /* function exit code */
10968 0 : __Pyx_RefNannyFinishContext();
10969 0 : return __pyx_r;
10970 : }
10971 :
10972 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10973 0 : PyObject *__pyx_r = NULL;
10974 : __Pyx_RefNannyDeclarations
10975 0 : PyObject *__pyx_t_1 = NULL;
10976 0 : int __pyx_lineno = 0;
10977 0 : const char *__pyx_filename = NULL;
10978 0 : int __pyx_clineno = 0;
10979 0 : __Pyx_RefNannySetupContext("__get__", 1);
10980 :
10981 : /* "View.MemoryView":562
10982 : * @property
10983 : * def base(self):
10984 : * return self._get_base() # <<<<<<<<<<<<<<
10985 : *
10986 : * cdef _get_base(self):
10987 : */
10988 0 : __Pyx_XDECREF(__pyx_r);
10989 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
10990 0 : __Pyx_GOTREF(__pyx_t_1);
10991 0 : __pyx_r = __pyx_t_1;
10992 0 : __pyx_t_1 = 0;
10993 0 : goto __pyx_L0;
10994 :
10995 : /* "View.MemoryView":560
10996 : * return result
10997 : *
10998 : * @property # <<<<<<<<<<<<<<
10999 : * def base(self):
11000 : * return self._get_base()
11001 : */
11002 :
11003 : /* function exit code */
11004 0 : __pyx_L1_error:;
11005 0 : __Pyx_XDECREF(__pyx_t_1);
11006 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11007 0 : __pyx_r = NULL;
11008 0 : __pyx_L0:;
11009 0 : __Pyx_XGIVEREF(__pyx_r);
11010 0 : __Pyx_RefNannyFinishContext();
11011 0 : return __pyx_r;
11012 : }
11013 :
11014 : /* "View.MemoryView":564
11015 : * return self._get_base()
11016 : *
11017 : * cdef _get_base(self): # <<<<<<<<<<<<<<
11018 : * return self.obj
11019 : *
11020 : */
11021 :
11022 6345 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
11023 6345 : PyObject *__pyx_r = NULL;
11024 : __Pyx_RefNannyDeclarations
11025 6345 : __Pyx_RefNannySetupContext("_get_base", 1);
11026 :
11027 : /* "View.MemoryView":565
11028 : *
11029 : * cdef _get_base(self):
11030 : * return self.obj # <<<<<<<<<<<<<<
11031 : *
11032 : * @property
11033 : */
11034 6345 : __Pyx_XDECREF(__pyx_r);
11035 6345 : __Pyx_INCREF(__pyx_v_self->obj);
11036 6345 : __pyx_r = __pyx_v_self->obj;
11037 6345 : goto __pyx_L0;
11038 :
11039 : /* "View.MemoryView":564
11040 : * return self._get_base()
11041 : *
11042 : * cdef _get_base(self): # <<<<<<<<<<<<<<
11043 : * return self.obj
11044 : *
11045 : */
11046 :
11047 : /* function exit code */
11048 6345 : __pyx_L0:;
11049 6345 : __Pyx_XGIVEREF(__pyx_r);
11050 6345 : __Pyx_RefNannyFinishContext();
11051 6345 : return __pyx_r;
11052 : }
11053 :
11054 : /* "View.MemoryView":567
11055 : * return self.obj
11056 : *
11057 : * @property # <<<<<<<<<<<<<<
11058 : * def shape(self):
11059 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11060 : */
11061 :
11062 : /* Python wrapper */
11063 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11064 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11065 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11066 0 : PyObject *__pyx_r = 0;
11067 : __Pyx_RefNannyDeclarations
11068 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11069 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11070 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11071 :
11072 : /* function exit code */
11073 0 : __Pyx_RefNannyFinishContext();
11074 0 : return __pyx_r;
11075 : }
11076 :
11077 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11078 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
11079 0 : PyObject *__pyx_r = NULL;
11080 : __Pyx_RefNannyDeclarations
11081 0 : PyObject *__pyx_t_1 = NULL;
11082 0 : Py_ssize_t *__pyx_t_2;
11083 0 : Py_ssize_t *__pyx_t_3;
11084 0 : Py_ssize_t *__pyx_t_4;
11085 0 : PyObject *__pyx_t_5 = NULL;
11086 0 : int __pyx_lineno = 0;
11087 0 : const char *__pyx_filename = NULL;
11088 0 : int __pyx_clineno = 0;
11089 0 : __Pyx_RefNannySetupContext("__get__", 1);
11090 :
11091 : /* "View.MemoryView":569
11092 : * @property
11093 : * def shape(self):
11094 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11095 : *
11096 : * @property
11097 : */
11098 0 : __Pyx_XDECREF(__pyx_r);
11099 0 : { /* enter inner scope */
11100 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
11101 0 : __Pyx_GOTREF(__pyx_t_1);
11102 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11103 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11104 0 : __pyx_t_2 = __pyx_t_4;
11105 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
11106 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
11107 0 : __Pyx_GOTREF(__pyx_t_5);
11108 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
11109 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11110 : }
11111 : } /* exit inner scope */
11112 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
11113 0 : __Pyx_GOTREF(__pyx_t_5);
11114 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11115 0 : __pyx_r = __pyx_t_5;
11116 0 : __pyx_t_5 = 0;
11117 0 : goto __pyx_L0;
11118 :
11119 : /* "View.MemoryView":567
11120 : * return self.obj
11121 : *
11122 : * @property # <<<<<<<<<<<<<<
11123 : * def shape(self):
11124 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11125 : */
11126 :
11127 : /* function exit code */
11128 0 : __pyx_L1_error:;
11129 0 : __Pyx_XDECREF(__pyx_t_1);
11130 0 : __Pyx_XDECREF(__pyx_t_5);
11131 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11132 0 : __pyx_r = NULL;
11133 0 : __pyx_L0:;
11134 0 : __Pyx_XGIVEREF(__pyx_r);
11135 0 : __Pyx_RefNannyFinishContext();
11136 0 : return __pyx_r;
11137 : }
11138 :
11139 : /* "View.MemoryView":571
11140 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11141 : *
11142 : * @property # <<<<<<<<<<<<<<
11143 : * def strides(self):
11144 : * if self.view.strides == NULL:
11145 : */
11146 :
11147 : /* Python wrapper */
11148 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11149 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11150 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11151 0 : PyObject *__pyx_r = 0;
11152 : __Pyx_RefNannyDeclarations
11153 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11154 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11155 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11156 :
11157 : /* function exit code */
11158 0 : __Pyx_RefNannyFinishContext();
11159 0 : return __pyx_r;
11160 : }
11161 :
11162 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11163 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
11164 0 : PyObject *__pyx_r = NULL;
11165 : __Pyx_RefNannyDeclarations
11166 0 : int __pyx_t_1;
11167 0 : PyObject *__pyx_t_2 = NULL;
11168 0 : Py_ssize_t *__pyx_t_3;
11169 0 : Py_ssize_t *__pyx_t_4;
11170 0 : Py_ssize_t *__pyx_t_5;
11171 0 : PyObject *__pyx_t_6 = NULL;
11172 0 : int __pyx_lineno = 0;
11173 0 : const char *__pyx_filename = NULL;
11174 0 : int __pyx_clineno = 0;
11175 0 : __Pyx_RefNannySetupContext("__get__", 1);
11176 :
11177 : /* "View.MemoryView":573
11178 : * @property
11179 : * def strides(self):
11180 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11181 : *
11182 : * raise ValueError, "Buffer view does not expose strides"
11183 : */
11184 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
11185 0 : if (unlikely(__pyx_t_1)) {
11186 :
11187 : /* "View.MemoryView":575
11188 : * if self.view.strides == NULL:
11189 : *
11190 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
11191 : *
11192 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11193 : */
11194 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
11195 0 : __PYX_ERR(1, 575, __pyx_L1_error)
11196 :
11197 : /* "View.MemoryView":573
11198 : * @property
11199 : * def strides(self):
11200 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11201 : *
11202 : * raise ValueError, "Buffer view does not expose strides"
11203 : */
11204 : }
11205 :
11206 : /* "View.MemoryView":577
11207 : * raise ValueError, "Buffer view does not expose strides"
11208 : *
11209 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11210 : *
11211 : * @property
11212 : */
11213 0 : __Pyx_XDECREF(__pyx_r);
11214 0 : { /* enter inner scope */
11215 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
11216 0 : __Pyx_GOTREF(__pyx_t_2);
11217 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11218 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11219 0 : __pyx_t_3 = __pyx_t_5;
11220 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
11221 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
11222 0 : __Pyx_GOTREF(__pyx_t_6);
11223 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
11224 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11225 : }
11226 : } /* exit inner scope */
11227 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
11228 0 : __Pyx_GOTREF(__pyx_t_6);
11229 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11230 0 : __pyx_r = __pyx_t_6;
11231 0 : __pyx_t_6 = 0;
11232 0 : goto __pyx_L0;
11233 :
11234 : /* "View.MemoryView":571
11235 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11236 : *
11237 : * @property # <<<<<<<<<<<<<<
11238 : * def strides(self):
11239 : * if self.view.strides == NULL:
11240 : */
11241 :
11242 : /* function exit code */
11243 0 : __pyx_L1_error:;
11244 0 : __Pyx_XDECREF(__pyx_t_2);
11245 0 : __Pyx_XDECREF(__pyx_t_6);
11246 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11247 0 : __pyx_r = NULL;
11248 0 : __pyx_L0:;
11249 0 : __Pyx_XGIVEREF(__pyx_r);
11250 0 : __Pyx_RefNannyFinishContext();
11251 0 : return __pyx_r;
11252 : }
11253 :
11254 : /* "View.MemoryView":579
11255 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11256 : *
11257 : * @property # <<<<<<<<<<<<<<
11258 : * def suboffsets(self):
11259 : * if self.view.suboffsets == NULL:
11260 : */
11261 :
11262 : /* Python wrapper */
11263 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11264 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11265 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11266 0 : PyObject *__pyx_r = 0;
11267 : __Pyx_RefNannyDeclarations
11268 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11269 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11270 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11271 :
11272 : /* function exit code */
11273 0 : __Pyx_RefNannyFinishContext();
11274 0 : return __pyx_r;
11275 : }
11276 :
11277 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11278 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
11279 0 : PyObject *__pyx_r = NULL;
11280 : __Pyx_RefNannyDeclarations
11281 0 : int __pyx_t_1;
11282 0 : PyObject *__pyx_t_2 = NULL;
11283 0 : Py_ssize_t *__pyx_t_3;
11284 0 : Py_ssize_t *__pyx_t_4;
11285 0 : Py_ssize_t *__pyx_t_5;
11286 0 : PyObject *__pyx_t_6 = NULL;
11287 0 : int __pyx_lineno = 0;
11288 0 : const char *__pyx_filename = NULL;
11289 0 : int __pyx_clineno = 0;
11290 0 : __Pyx_RefNannySetupContext("__get__", 1);
11291 :
11292 : /* "View.MemoryView":581
11293 : * @property
11294 : * def suboffsets(self):
11295 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11296 : * return (-1,) * self.view.ndim
11297 : *
11298 : */
11299 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
11300 0 : if (__pyx_t_1) {
11301 :
11302 : /* "View.MemoryView":582
11303 : * def suboffsets(self):
11304 : * if self.view.suboffsets == NULL:
11305 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11306 : *
11307 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11308 : */
11309 0 : __Pyx_XDECREF(__pyx_r);
11310 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
11311 0 : __Pyx_GOTREF(__pyx_t_2);
11312 0 : __pyx_r = __pyx_t_2;
11313 0 : __pyx_t_2 = 0;
11314 0 : goto __pyx_L0;
11315 :
11316 : /* "View.MemoryView":581
11317 : * @property
11318 : * def suboffsets(self):
11319 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11320 : * return (-1,) * self.view.ndim
11321 : *
11322 : */
11323 : }
11324 :
11325 : /* "View.MemoryView":584
11326 : * return (-1,) * self.view.ndim
11327 : *
11328 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11329 : *
11330 : * @property
11331 : */
11332 0 : __Pyx_XDECREF(__pyx_r);
11333 0 : { /* enter inner scope */
11334 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
11335 0 : __Pyx_GOTREF(__pyx_t_2);
11336 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11337 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11338 0 : __pyx_t_3 = __pyx_t_5;
11339 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
11340 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
11341 0 : __Pyx_GOTREF(__pyx_t_6);
11342 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
11343 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11344 : }
11345 : } /* exit inner scope */
11346 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
11347 0 : __Pyx_GOTREF(__pyx_t_6);
11348 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11349 0 : __pyx_r = __pyx_t_6;
11350 0 : __pyx_t_6 = 0;
11351 0 : goto __pyx_L0;
11352 :
11353 : /* "View.MemoryView":579
11354 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11355 : *
11356 : * @property # <<<<<<<<<<<<<<
11357 : * def suboffsets(self):
11358 : * if self.view.suboffsets == NULL:
11359 : */
11360 :
11361 : /* function exit code */
11362 0 : __pyx_L1_error:;
11363 0 : __Pyx_XDECREF(__pyx_t_2);
11364 0 : __Pyx_XDECREF(__pyx_t_6);
11365 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11366 0 : __pyx_r = NULL;
11367 0 : __pyx_L0:;
11368 0 : __Pyx_XGIVEREF(__pyx_r);
11369 0 : __Pyx_RefNannyFinishContext();
11370 0 : return __pyx_r;
11371 : }
11372 :
11373 : /* "View.MemoryView":586
11374 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11375 : *
11376 : * @property # <<<<<<<<<<<<<<
11377 : * def ndim(self):
11378 : * return self.view.ndim
11379 : */
11380 :
11381 : /* Python wrapper */
11382 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11383 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11384 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11385 0 : PyObject *__pyx_r = 0;
11386 : __Pyx_RefNannyDeclarations
11387 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11388 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11389 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11390 :
11391 : /* function exit code */
11392 0 : __Pyx_RefNannyFinishContext();
11393 0 : return __pyx_r;
11394 : }
11395 :
11396 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11397 0 : PyObject *__pyx_r = NULL;
11398 : __Pyx_RefNannyDeclarations
11399 0 : PyObject *__pyx_t_1 = NULL;
11400 0 : int __pyx_lineno = 0;
11401 0 : const char *__pyx_filename = NULL;
11402 0 : int __pyx_clineno = 0;
11403 0 : __Pyx_RefNannySetupContext("__get__", 1);
11404 :
11405 : /* "View.MemoryView":588
11406 : * @property
11407 : * def ndim(self):
11408 : * return self.view.ndim # <<<<<<<<<<<<<<
11409 : *
11410 : * @property
11411 : */
11412 0 : __Pyx_XDECREF(__pyx_r);
11413 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
11414 0 : __Pyx_GOTREF(__pyx_t_1);
11415 0 : __pyx_r = __pyx_t_1;
11416 0 : __pyx_t_1 = 0;
11417 0 : goto __pyx_L0;
11418 :
11419 : /* "View.MemoryView":586
11420 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11421 : *
11422 : * @property # <<<<<<<<<<<<<<
11423 : * def ndim(self):
11424 : * return self.view.ndim
11425 : */
11426 :
11427 : /* function exit code */
11428 0 : __pyx_L1_error:;
11429 0 : __Pyx_XDECREF(__pyx_t_1);
11430 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11431 0 : __pyx_r = NULL;
11432 0 : __pyx_L0:;
11433 0 : __Pyx_XGIVEREF(__pyx_r);
11434 0 : __Pyx_RefNannyFinishContext();
11435 0 : return __pyx_r;
11436 : }
11437 :
11438 : /* "View.MemoryView":590
11439 : * return self.view.ndim
11440 : *
11441 : * @property # <<<<<<<<<<<<<<
11442 : * def itemsize(self):
11443 : * return self.view.itemsize
11444 : */
11445 :
11446 : /* Python wrapper */
11447 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
11448 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11449 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11450 0 : PyObject *__pyx_r = 0;
11451 : __Pyx_RefNannyDeclarations
11452 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11453 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11454 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11455 :
11456 : /* function exit code */
11457 0 : __Pyx_RefNannyFinishContext();
11458 0 : return __pyx_r;
11459 : }
11460 :
11461 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11462 0 : PyObject *__pyx_r = NULL;
11463 : __Pyx_RefNannyDeclarations
11464 0 : PyObject *__pyx_t_1 = NULL;
11465 0 : int __pyx_lineno = 0;
11466 0 : const char *__pyx_filename = NULL;
11467 0 : int __pyx_clineno = 0;
11468 0 : __Pyx_RefNannySetupContext("__get__", 1);
11469 :
11470 : /* "View.MemoryView":592
11471 : * @property
11472 : * def itemsize(self):
11473 : * return self.view.itemsize # <<<<<<<<<<<<<<
11474 : *
11475 : * @property
11476 : */
11477 0 : __Pyx_XDECREF(__pyx_r);
11478 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
11479 0 : __Pyx_GOTREF(__pyx_t_1);
11480 0 : __pyx_r = __pyx_t_1;
11481 0 : __pyx_t_1 = 0;
11482 0 : goto __pyx_L0;
11483 :
11484 : /* "View.MemoryView":590
11485 : * return self.view.ndim
11486 : *
11487 : * @property # <<<<<<<<<<<<<<
11488 : * def itemsize(self):
11489 : * return self.view.itemsize
11490 : */
11491 :
11492 : /* function exit code */
11493 0 : __pyx_L1_error:;
11494 0 : __Pyx_XDECREF(__pyx_t_1);
11495 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11496 0 : __pyx_r = NULL;
11497 0 : __pyx_L0:;
11498 0 : __Pyx_XGIVEREF(__pyx_r);
11499 0 : __Pyx_RefNannyFinishContext();
11500 0 : return __pyx_r;
11501 : }
11502 :
11503 : /* "View.MemoryView":594
11504 : * return self.view.itemsize
11505 : *
11506 : * @property # <<<<<<<<<<<<<<
11507 : * def nbytes(self):
11508 : * return self.size * self.view.itemsize
11509 : */
11510 :
11511 : /* Python wrapper */
11512 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
11513 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11514 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11515 0 : PyObject *__pyx_r = 0;
11516 : __Pyx_RefNannyDeclarations
11517 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11518 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11519 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11520 :
11521 : /* function exit code */
11522 0 : __Pyx_RefNannyFinishContext();
11523 0 : return __pyx_r;
11524 : }
11525 :
11526 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11527 0 : PyObject *__pyx_r = NULL;
11528 : __Pyx_RefNannyDeclarations
11529 0 : PyObject *__pyx_t_1 = NULL;
11530 0 : PyObject *__pyx_t_2 = NULL;
11531 0 : PyObject *__pyx_t_3 = NULL;
11532 0 : int __pyx_lineno = 0;
11533 0 : const char *__pyx_filename = NULL;
11534 0 : int __pyx_clineno = 0;
11535 0 : __Pyx_RefNannySetupContext("__get__", 1);
11536 :
11537 : /* "View.MemoryView":596
11538 : * @property
11539 : * def nbytes(self):
11540 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
11541 : *
11542 : * @property
11543 : */
11544 0 : __Pyx_XDECREF(__pyx_r);
11545 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
11546 0 : __Pyx_GOTREF(__pyx_t_1);
11547 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
11548 0 : __Pyx_GOTREF(__pyx_t_2);
11549 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
11550 0 : __Pyx_GOTREF(__pyx_t_3);
11551 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11552 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11553 0 : __pyx_r = __pyx_t_3;
11554 0 : __pyx_t_3 = 0;
11555 0 : goto __pyx_L0;
11556 :
11557 : /* "View.MemoryView":594
11558 : * return self.view.itemsize
11559 : *
11560 : * @property # <<<<<<<<<<<<<<
11561 : * def nbytes(self):
11562 : * return self.size * self.view.itemsize
11563 : */
11564 :
11565 : /* function exit code */
11566 0 : __pyx_L1_error:;
11567 0 : __Pyx_XDECREF(__pyx_t_1);
11568 0 : __Pyx_XDECREF(__pyx_t_2);
11569 0 : __Pyx_XDECREF(__pyx_t_3);
11570 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11571 0 : __pyx_r = NULL;
11572 0 : __pyx_L0:;
11573 0 : __Pyx_XGIVEREF(__pyx_r);
11574 0 : __Pyx_RefNannyFinishContext();
11575 0 : return __pyx_r;
11576 : }
11577 :
11578 : /* "View.MemoryView":598
11579 : * return self.size * self.view.itemsize
11580 : *
11581 : * @property # <<<<<<<<<<<<<<
11582 : * def size(self):
11583 : * if self._size is None:
11584 : */
11585 :
11586 : /* Python wrapper */
11587 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11588 4004 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11589 4004 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11590 4004 : PyObject *__pyx_r = 0;
11591 : __Pyx_RefNannyDeclarations
11592 4004 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11593 4004 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11594 8008 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11595 :
11596 : /* function exit code */
11597 4004 : __Pyx_RefNannyFinishContext();
11598 4004 : return __pyx_r;
11599 : }
11600 :
11601 4004 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11602 4004 : PyObject *__pyx_v_result = NULL;
11603 4004 : PyObject *__pyx_v_length = NULL;
11604 4004 : PyObject *__pyx_r = NULL;
11605 : __Pyx_RefNannyDeclarations
11606 4004 : int __pyx_t_1;
11607 4004 : Py_ssize_t *__pyx_t_2;
11608 4004 : Py_ssize_t *__pyx_t_3;
11609 4004 : Py_ssize_t *__pyx_t_4;
11610 4004 : PyObject *__pyx_t_5 = NULL;
11611 4004 : int __pyx_lineno = 0;
11612 4004 : const char *__pyx_filename = NULL;
11613 4004 : int __pyx_clineno = 0;
11614 4004 : __Pyx_RefNannySetupContext("__get__", 1);
11615 :
11616 : /* "View.MemoryView":600
11617 : * @property
11618 : * def size(self):
11619 : * if self._size is None: # <<<<<<<<<<<<<<
11620 : * result = 1
11621 : *
11622 : */
11623 4004 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11624 4004 : if (__pyx_t_1) {
11625 :
11626 : /* "View.MemoryView":601
11627 : * def size(self):
11628 : * if self._size is None:
11629 : * result = 1 # <<<<<<<<<<<<<<
11630 : *
11631 : * for length in self.view.shape[:self.view.ndim]:
11632 : */
11633 4004 : __Pyx_INCREF(__pyx_int_1);
11634 4004 : __pyx_v_result = __pyx_int_1;
11635 :
11636 : /* "View.MemoryView":603
11637 : * result = 1
11638 : *
11639 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11640 : * result *= length
11641 : *
11642 : */
11643 4004 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11644 8008 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11645 4004 : __pyx_t_2 = __pyx_t_4;
11646 4004 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
11647 4004 : __Pyx_GOTREF(__pyx_t_5);
11648 4004 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
11649 4004 : __pyx_t_5 = 0;
11650 :
11651 : /* "View.MemoryView":604
11652 : *
11653 : * for length in self.view.shape[:self.view.ndim]:
11654 : * result *= length # <<<<<<<<<<<<<<
11655 : *
11656 : * self._size = result
11657 : */
11658 4004 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
11659 4004 : __Pyx_GOTREF(__pyx_t_5);
11660 4004 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
11661 4004 : __pyx_t_5 = 0;
11662 : }
11663 :
11664 : /* "View.MemoryView":606
11665 : * result *= length
11666 : *
11667 : * self._size = result # <<<<<<<<<<<<<<
11668 : *
11669 : * return self._size
11670 : */
11671 4004 : __Pyx_INCREF(__pyx_v_result);
11672 4004 : __Pyx_GIVEREF(__pyx_v_result);
11673 4004 : __Pyx_GOTREF(__pyx_v_self->_size);
11674 4004 : __Pyx_DECREF(__pyx_v_self->_size);
11675 4004 : __pyx_v_self->_size = __pyx_v_result;
11676 :
11677 : /* "View.MemoryView":600
11678 : * @property
11679 : * def size(self):
11680 : * if self._size is None: # <<<<<<<<<<<<<<
11681 : * result = 1
11682 : *
11683 : */
11684 : }
11685 :
11686 : /* "View.MemoryView":608
11687 : * self._size = result
11688 : *
11689 : * return self._size # <<<<<<<<<<<<<<
11690 : *
11691 : * def __len__(self):
11692 : */
11693 4004 : __Pyx_XDECREF(__pyx_r);
11694 4004 : __Pyx_INCREF(__pyx_v_self->_size);
11695 4004 : __pyx_r = __pyx_v_self->_size;
11696 4004 : goto __pyx_L0;
11697 :
11698 : /* "View.MemoryView":598
11699 : * return self.size * self.view.itemsize
11700 : *
11701 : * @property # <<<<<<<<<<<<<<
11702 : * def size(self):
11703 : * if self._size is None:
11704 : */
11705 :
11706 : /* function exit code */
11707 0 : __pyx_L1_error:;
11708 0 : __Pyx_XDECREF(__pyx_t_5);
11709 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11710 0 : __pyx_r = NULL;
11711 4004 : __pyx_L0:;
11712 4004 : __Pyx_XDECREF(__pyx_v_result);
11713 4004 : __Pyx_XDECREF(__pyx_v_length);
11714 4004 : __Pyx_XGIVEREF(__pyx_r);
11715 4004 : __Pyx_RefNannyFinishContext();
11716 4004 : return __pyx_r;
11717 : }
11718 :
11719 : /* "View.MemoryView":610
11720 : * return self._size
11721 : *
11722 : * def __len__(self): # <<<<<<<<<<<<<<
11723 : * if self.view.ndim >= 1:
11724 : * return self.view.shape[0]
11725 : */
11726 :
11727 : /* Python wrapper */
11728 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11729 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11730 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11731 0 : Py_ssize_t __pyx_r;
11732 : __Pyx_RefNannyDeclarations
11733 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11734 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11735 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11736 :
11737 : /* function exit code */
11738 0 : __Pyx_RefNannyFinishContext();
11739 0 : return __pyx_r;
11740 : }
11741 :
11742 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11743 0 : Py_ssize_t __pyx_r;
11744 0 : int __pyx_t_1;
11745 :
11746 : /* "View.MemoryView":611
11747 : *
11748 : * def __len__(self):
11749 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11750 : * return self.view.shape[0]
11751 : *
11752 : */
11753 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11754 0 : if (__pyx_t_1) {
11755 :
11756 : /* "View.MemoryView":612
11757 : * def __len__(self):
11758 : * if self.view.ndim >= 1:
11759 : * return self.view.shape[0] # <<<<<<<<<<<<<<
11760 : *
11761 : * return 0
11762 : */
11763 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
11764 0 : goto __pyx_L0;
11765 :
11766 : /* "View.MemoryView":611
11767 : *
11768 : * def __len__(self):
11769 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11770 : * return self.view.shape[0]
11771 : *
11772 : */
11773 : }
11774 :
11775 : /* "View.MemoryView":614
11776 : * return self.view.shape[0]
11777 : *
11778 : * return 0 # <<<<<<<<<<<<<<
11779 : *
11780 : * def __repr__(self):
11781 : */
11782 0 : __pyx_r = 0;
11783 0 : goto __pyx_L0;
11784 :
11785 : /* "View.MemoryView":610
11786 : * return self._size
11787 : *
11788 : * def __len__(self): # <<<<<<<<<<<<<<
11789 : * if self.view.ndim >= 1:
11790 : * return self.view.shape[0]
11791 : */
11792 :
11793 : /* function exit code */
11794 0 : __pyx_L0:;
11795 0 : return __pyx_r;
11796 : }
11797 :
11798 : /* "View.MemoryView":616
11799 : * return 0
11800 : *
11801 : * def __repr__(self): # <<<<<<<<<<<<<<
11802 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11803 : * id(self))
11804 : */
11805 :
11806 : /* Python wrapper */
11807 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11808 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11809 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11810 0 : PyObject *__pyx_r = 0;
11811 : __Pyx_RefNannyDeclarations
11812 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11813 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11814 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11815 :
11816 : /* function exit code */
11817 0 : __Pyx_RefNannyFinishContext();
11818 0 : return __pyx_r;
11819 : }
11820 :
11821 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11822 0 : PyObject *__pyx_r = NULL;
11823 : __Pyx_RefNannyDeclarations
11824 0 : PyObject *__pyx_t_1 = NULL;
11825 0 : PyObject *__pyx_t_2 = NULL;
11826 0 : PyObject *__pyx_t_3 = NULL;
11827 0 : int __pyx_lineno = 0;
11828 0 : const char *__pyx_filename = NULL;
11829 0 : int __pyx_clineno = 0;
11830 0 : __Pyx_RefNannySetupContext("__repr__", 1);
11831 :
11832 : /* "View.MemoryView":617
11833 : *
11834 : * def __repr__(self):
11835 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11836 : * id(self))
11837 : *
11838 : */
11839 0 : __Pyx_XDECREF(__pyx_r);
11840 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11841 0 : __Pyx_GOTREF(__pyx_t_1);
11842 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11843 0 : __Pyx_GOTREF(__pyx_t_2);
11844 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11845 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11846 0 : __Pyx_GOTREF(__pyx_t_1);
11847 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11848 :
11849 : /* "View.MemoryView":618
11850 : * def __repr__(self):
11851 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11852 : * id(self)) # <<<<<<<<<<<<<<
11853 : *
11854 : * def __str__(self):
11855 : */
11856 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
11857 0 : __Pyx_GOTREF(__pyx_t_2);
11858 :
11859 : /* "View.MemoryView":617
11860 : *
11861 : * def __repr__(self):
11862 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11863 : * id(self))
11864 : *
11865 : */
11866 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
11867 0 : __Pyx_GOTREF(__pyx_t_3);
11868 0 : __Pyx_GIVEREF(__pyx_t_1);
11869 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
11870 0 : __Pyx_GIVEREF(__pyx_t_2);
11871 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
11872 0 : __pyx_t_1 = 0;
11873 0 : __pyx_t_2 = 0;
11874 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11875 0 : __Pyx_GOTREF(__pyx_t_2);
11876 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11877 0 : __pyx_r = __pyx_t_2;
11878 0 : __pyx_t_2 = 0;
11879 0 : goto __pyx_L0;
11880 :
11881 : /* "View.MemoryView":616
11882 : * return 0
11883 : *
11884 : * def __repr__(self): # <<<<<<<<<<<<<<
11885 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11886 : * id(self))
11887 : */
11888 :
11889 : /* function exit code */
11890 0 : __pyx_L1_error:;
11891 0 : __Pyx_XDECREF(__pyx_t_1);
11892 0 : __Pyx_XDECREF(__pyx_t_2);
11893 0 : __Pyx_XDECREF(__pyx_t_3);
11894 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11895 0 : __pyx_r = NULL;
11896 0 : __pyx_L0:;
11897 0 : __Pyx_XGIVEREF(__pyx_r);
11898 0 : __Pyx_RefNannyFinishContext();
11899 0 : return __pyx_r;
11900 : }
11901 :
11902 : /* "View.MemoryView":620
11903 : * id(self))
11904 : *
11905 : * def __str__(self): # <<<<<<<<<<<<<<
11906 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11907 : *
11908 : */
11909 :
11910 : /* Python wrapper */
11911 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11912 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11913 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11914 0 : PyObject *__pyx_r = 0;
11915 : __Pyx_RefNannyDeclarations
11916 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11917 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11918 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11919 :
11920 : /* function exit code */
11921 0 : __Pyx_RefNannyFinishContext();
11922 0 : return __pyx_r;
11923 : }
11924 :
11925 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11926 0 : PyObject *__pyx_r = NULL;
11927 : __Pyx_RefNannyDeclarations
11928 0 : PyObject *__pyx_t_1 = NULL;
11929 0 : PyObject *__pyx_t_2 = NULL;
11930 0 : int __pyx_lineno = 0;
11931 0 : const char *__pyx_filename = NULL;
11932 0 : int __pyx_clineno = 0;
11933 0 : __Pyx_RefNannySetupContext("__str__", 1);
11934 :
11935 : /* "View.MemoryView":621
11936 : *
11937 : * def __str__(self):
11938 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11939 : *
11940 : *
11941 : */
11942 0 : __Pyx_XDECREF(__pyx_r);
11943 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11944 0 : __Pyx_GOTREF(__pyx_t_1);
11945 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11946 0 : __Pyx_GOTREF(__pyx_t_2);
11947 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11948 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11949 0 : __Pyx_GOTREF(__pyx_t_1);
11950 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11951 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11952 0 : __Pyx_GOTREF(__pyx_t_2);
11953 0 : __Pyx_GIVEREF(__pyx_t_1);
11954 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
11955 0 : __pyx_t_1 = 0;
11956 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11957 0 : __Pyx_GOTREF(__pyx_t_1);
11958 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11959 0 : __pyx_r = __pyx_t_1;
11960 0 : __pyx_t_1 = 0;
11961 0 : goto __pyx_L0;
11962 :
11963 : /* "View.MemoryView":620
11964 : * id(self))
11965 : *
11966 : * def __str__(self): # <<<<<<<<<<<<<<
11967 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11968 : *
11969 : */
11970 :
11971 : /* function exit code */
11972 0 : __pyx_L1_error:;
11973 0 : __Pyx_XDECREF(__pyx_t_1);
11974 0 : __Pyx_XDECREF(__pyx_t_2);
11975 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11976 0 : __pyx_r = NULL;
11977 0 : __pyx_L0:;
11978 0 : __Pyx_XGIVEREF(__pyx_r);
11979 0 : __Pyx_RefNannyFinishContext();
11980 0 : return __pyx_r;
11981 : }
11982 :
11983 : /* "View.MemoryView":624
11984 : *
11985 : *
11986 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11987 : * cdef __Pyx_memviewslice *mslice
11988 : * cdef __Pyx_memviewslice tmp
11989 : */
11990 :
11991 : /* Python wrapper */
11992 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11993 : #if CYTHON_METH_FASTCALL
11994 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11995 : #else
11996 : PyObject *__pyx_args, PyObject *__pyx_kwds
11997 : #endif
11998 : ); /*proto*/
11999 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12000 : #if CYTHON_METH_FASTCALL
12001 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12002 : #else
12003 : PyObject *__pyx_args, PyObject *__pyx_kwds
12004 : #endif
12005 : ) {
12006 : #if !CYTHON_METH_FASTCALL
12007 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12008 : #endif
12009 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12010 0 : PyObject *__pyx_r = 0;
12011 : __Pyx_RefNannyDeclarations
12012 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12013 : #if !CYTHON_METH_FASTCALL
12014 : #if CYTHON_ASSUME_SAFE_MACROS
12015 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12016 : #else
12017 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12018 : #endif
12019 : #endif
12020 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12021 0 : if (unlikely(__pyx_nargs > 0)) {
12022 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
12023 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
12024 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12025 :
12026 : /* function exit code */
12027 0 : __Pyx_RefNannyFinishContext();
12028 0 : return __pyx_r;
12029 : }
12030 :
12031 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12032 0 : __Pyx_memviewslice *__pyx_v_mslice;
12033 0 : __Pyx_memviewslice __pyx_v_tmp;
12034 0 : PyObject *__pyx_r = NULL;
12035 : __Pyx_RefNannyDeclarations
12036 0 : __Pyx_memviewslice *__pyx_t_1;
12037 0 : PyObject *__pyx_t_2 = NULL;
12038 0 : int __pyx_lineno = 0;
12039 0 : const char *__pyx_filename = NULL;
12040 0 : int __pyx_clineno = 0;
12041 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
12042 :
12043 : /* "View.MemoryView":627
12044 : * cdef __Pyx_memviewslice *mslice
12045 : * cdef __Pyx_memviewslice tmp
12046 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12047 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12048 : *
12049 : */
12050 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
12051 0 : __pyx_v_mslice = __pyx_t_1;
12052 :
12053 : /* "View.MemoryView":628
12054 : * cdef __Pyx_memviewslice tmp
12055 : * mslice = get_slice_from_memview(self, &tmp)
12056 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12057 : *
12058 : * def is_f_contig(self):
12059 : */
12060 0 : __Pyx_XDECREF(__pyx_r);
12061 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
12062 0 : __Pyx_GOTREF(__pyx_t_2);
12063 0 : __pyx_r = __pyx_t_2;
12064 0 : __pyx_t_2 = 0;
12065 0 : goto __pyx_L0;
12066 :
12067 : /* "View.MemoryView":624
12068 : *
12069 : *
12070 : * def is_c_contig(self): # <<<<<<<<<<<<<<
12071 : * cdef __Pyx_memviewslice *mslice
12072 : * cdef __Pyx_memviewslice tmp
12073 : */
12074 :
12075 : /* function exit code */
12076 0 : __pyx_L1_error:;
12077 0 : __Pyx_XDECREF(__pyx_t_2);
12078 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12079 : __pyx_r = NULL;
12080 0 : __pyx_L0:;
12081 0 : __Pyx_XGIVEREF(__pyx_r);
12082 0 : __Pyx_RefNannyFinishContext();
12083 0 : return __pyx_r;
12084 : }
12085 :
12086 : /* "View.MemoryView":630
12087 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12088 : *
12089 : * def is_f_contig(self): # <<<<<<<<<<<<<<
12090 : * cdef __Pyx_memviewslice *mslice
12091 : * cdef __Pyx_memviewslice tmp
12092 : */
12093 :
12094 : /* Python wrapper */
12095 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12096 : #if CYTHON_METH_FASTCALL
12097 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12098 : #else
12099 : PyObject *__pyx_args, PyObject *__pyx_kwds
12100 : #endif
12101 : ); /*proto*/
12102 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12103 : #if CYTHON_METH_FASTCALL
12104 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12105 : #else
12106 : PyObject *__pyx_args, PyObject *__pyx_kwds
12107 : #endif
12108 : ) {
12109 : #if !CYTHON_METH_FASTCALL
12110 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12111 : #endif
12112 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12113 0 : PyObject *__pyx_r = 0;
12114 : __Pyx_RefNannyDeclarations
12115 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12116 : #if !CYTHON_METH_FASTCALL
12117 : #if CYTHON_ASSUME_SAFE_MACROS
12118 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12119 : #else
12120 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12121 : #endif
12122 : #endif
12123 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12124 0 : if (unlikely(__pyx_nargs > 0)) {
12125 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
12126 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
12127 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12128 :
12129 : /* function exit code */
12130 0 : __Pyx_RefNannyFinishContext();
12131 0 : return __pyx_r;
12132 : }
12133 :
12134 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12135 0 : __Pyx_memviewslice *__pyx_v_mslice;
12136 0 : __Pyx_memviewslice __pyx_v_tmp;
12137 0 : PyObject *__pyx_r = NULL;
12138 : __Pyx_RefNannyDeclarations
12139 0 : __Pyx_memviewslice *__pyx_t_1;
12140 0 : PyObject *__pyx_t_2 = NULL;
12141 0 : int __pyx_lineno = 0;
12142 0 : const char *__pyx_filename = NULL;
12143 0 : int __pyx_clineno = 0;
12144 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
12145 :
12146 : /* "View.MemoryView":633
12147 : * cdef __Pyx_memviewslice *mslice
12148 : * cdef __Pyx_memviewslice tmp
12149 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12150 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12151 : *
12152 : */
12153 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
12154 0 : __pyx_v_mslice = __pyx_t_1;
12155 :
12156 : /* "View.MemoryView":634
12157 : * cdef __Pyx_memviewslice tmp
12158 : * mslice = get_slice_from_memview(self, &tmp)
12159 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12160 : *
12161 : * def copy(self):
12162 : */
12163 0 : __Pyx_XDECREF(__pyx_r);
12164 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
12165 0 : __Pyx_GOTREF(__pyx_t_2);
12166 0 : __pyx_r = __pyx_t_2;
12167 0 : __pyx_t_2 = 0;
12168 0 : goto __pyx_L0;
12169 :
12170 : /* "View.MemoryView":630
12171 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12172 : *
12173 : * def is_f_contig(self): # <<<<<<<<<<<<<<
12174 : * cdef __Pyx_memviewslice *mslice
12175 : * cdef __Pyx_memviewslice tmp
12176 : */
12177 :
12178 : /* function exit code */
12179 0 : __pyx_L1_error:;
12180 0 : __Pyx_XDECREF(__pyx_t_2);
12181 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12182 : __pyx_r = NULL;
12183 0 : __pyx_L0:;
12184 0 : __Pyx_XGIVEREF(__pyx_r);
12185 0 : __Pyx_RefNannyFinishContext();
12186 0 : return __pyx_r;
12187 : }
12188 :
12189 : /* "View.MemoryView":636
12190 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12191 : *
12192 : * def copy(self): # <<<<<<<<<<<<<<
12193 : * cdef __Pyx_memviewslice mslice
12194 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12195 : */
12196 :
12197 : /* Python wrapper */
12198 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12199 : #if CYTHON_METH_FASTCALL
12200 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12201 : #else
12202 : PyObject *__pyx_args, PyObject *__pyx_kwds
12203 : #endif
12204 : ); /*proto*/
12205 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12206 : #if CYTHON_METH_FASTCALL
12207 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12208 : #else
12209 : PyObject *__pyx_args, PyObject *__pyx_kwds
12210 : #endif
12211 : ) {
12212 : #if !CYTHON_METH_FASTCALL
12213 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12214 : #endif
12215 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12216 0 : PyObject *__pyx_r = 0;
12217 : __Pyx_RefNannyDeclarations
12218 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12219 : #if !CYTHON_METH_FASTCALL
12220 : #if CYTHON_ASSUME_SAFE_MACROS
12221 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12222 : #else
12223 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12224 : #endif
12225 : #endif
12226 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12227 0 : if (unlikely(__pyx_nargs > 0)) {
12228 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
12229 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
12230 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12231 :
12232 : /* function exit code */
12233 0 : __Pyx_RefNannyFinishContext();
12234 0 : return __pyx_r;
12235 : }
12236 :
12237 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12238 0 : __Pyx_memviewslice __pyx_v_mslice;
12239 0 : int __pyx_v_flags;
12240 0 : PyObject *__pyx_r = NULL;
12241 : __Pyx_RefNannyDeclarations
12242 0 : __Pyx_memviewslice __pyx_t_1;
12243 0 : PyObject *__pyx_t_2 = NULL;
12244 0 : int __pyx_lineno = 0;
12245 0 : const char *__pyx_filename = NULL;
12246 0 : int __pyx_clineno = 0;
12247 0 : __Pyx_RefNannySetupContext("copy", 1);
12248 :
12249 : /* "View.MemoryView":638
12250 : * def copy(self):
12251 : * cdef __Pyx_memviewslice mslice
12252 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12253 : *
12254 : * slice_copy(self, &mslice)
12255 : */
12256 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12257 :
12258 : /* "View.MemoryView":640
12259 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12260 : *
12261 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12262 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12263 : * self.view.itemsize,
12264 : */
12265 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12266 :
12267 : /* "View.MemoryView":641
12268 : *
12269 : * slice_copy(self, &mslice)
12270 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12271 : * self.view.itemsize,
12272 : * flags|PyBUF_C_CONTIGUOUS,
12273 : */
12274 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
12275 0 : __pyx_v_mslice = __pyx_t_1;
12276 :
12277 : /* "View.MemoryView":646
12278 : * self.dtype_is_object)
12279 : *
12280 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12281 : *
12282 : * def copy_fortran(self):
12283 : */
12284 0 : __Pyx_XDECREF(__pyx_r);
12285 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
12286 0 : __Pyx_GOTREF(__pyx_t_2);
12287 0 : __pyx_r = __pyx_t_2;
12288 0 : __pyx_t_2 = 0;
12289 0 : goto __pyx_L0;
12290 :
12291 : /* "View.MemoryView":636
12292 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12293 : *
12294 : * def copy(self): # <<<<<<<<<<<<<<
12295 : * cdef __Pyx_memviewslice mslice
12296 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12297 : */
12298 :
12299 : /* function exit code */
12300 0 : __pyx_L1_error:;
12301 0 : __Pyx_XDECREF(__pyx_t_2);
12302 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12303 : __pyx_r = NULL;
12304 0 : __pyx_L0:;
12305 0 : __Pyx_XGIVEREF(__pyx_r);
12306 0 : __Pyx_RefNannyFinishContext();
12307 0 : return __pyx_r;
12308 : }
12309 :
12310 : /* "View.MemoryView":648
12311 : * return memoryview_copy_from_slice(self, &mslice)
12312 : *
12313 : * def copy_fortran(self): # <<<<<<<<<<<<<<
12314 : * cdef __Pyx_memviewslice src, dst
12315 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12316 : */
12317 :
12318 : /* Python wrapper */
12319 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12320 : #if CYTHON_METH_FASTCALL
12321 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12322 : #else
12323 : PyObject *__pyx_args, PyObject *__pyx_kwds
12324 : #endif
12325 : ); /*proto*/
12326 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12327 : #if CYTHON_METH_FASTCALL
12328 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12329 : #else
12330 : PyObject *__pyx_args, PyObject *__pyx_kwds
12331 : #endif
12332 : ) {
12333 : #if !CYTHON_METH_FASTCALL
12334 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12335 : #endif
12336 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12337 0 : PyObject *__pyx_r = 0;
12338 : __Pyx_RefNannyDeclarations
12339 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12340 : #if !CYTHON_METH_FASTCALL
12341 : #if CYTHON_ASSUME_SAFE_MACROS
12342 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12343 : #else
12344 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12345 : #endif
12346 : #endif
12347 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12348 0 : if (unlikely(__pyx_nargs > 0)) {
12349 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
12350 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
12351 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12352 :
12353 : /* function exit code */
12354 0 : __Pyx_RefNannyFinishContext();
12355 0 : return __pyx_r;
12356 : }
12357 :
12358 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12359 0 : __Pyx_memviewslice __pyx_v_src;
12360 0 : __Pyx_memviewslice __pyx_v_dst;
12361 0 : int __pyx_v_flags;
12362 0 : PyObject *__pyx_r = NULL;
12363 : __Pyx_RefNannyDeclarations
12364 0 : __Pyx_memviewslice __pyx_t_1;
12365 0 : PyObject *__pyx_t_2 = NULL;
12366 0 : int __pyx_lineno = 0;
12367 0 : const char *__pyx_filename = NULL;
12368 0 : int __pyx_clineno = 0;
12369 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
12370 :
12371 : /* "View.MemoryView":650
12372 : * def copy_fortran(self):
12373 : * cdef __Pyx_memviewslice src, dst
12374 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12375 : *
12376 : * slice_copy(self, &src)
12377 : */
12378 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12379 :
12380 : /* "View.MemoryView":652
12381 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12382 : *
12383 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
12384 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12385 : * self.view.itemsize,
12386 : */
12387 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12388 :
12389 : /* "View.MemoryView":653
12390 : *
12391 : * slice_copy(self, &src)
12392 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12393 : * self.view.itemsize,
12394 : * flags|PyBUF_F_CONTIGUOUS,
12395 : */
12396 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
12397 0 : __pyx_v_dst = __pyx_t_1;
12398 :
12399 : /* "View.MemoryView":658
12400 : * self.dtype_is_object)
12401 : *
12402 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12403 : *
12404 : *
12405 : */
12406 0 : __Pyx_XDECREF(__pyx_r);
12407 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
12408 0 : __Pyx_GOTREF(__pyx_t_2);
12409 0 : __pyx_r = __pyx_t_2;
12410 0 : __pyx_t_2 = 0;
12411 0 : goto __pyx_L0;
12412 :
12413 : /* "View.MemoryView":648
12414 : * return memoryview_copy_from_slice(self, &mslice)
12415 : *
12416 : * def copy_fortran(self): # <<<<<<<<<<<<<<
12417 : * cdef __Pyx_memviewslice src, dst
12418 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12419 : */
12420 :
12421 : /* function exit code */
12422 0 : __pyx_L1_error:;
12423 0 : __Pyx_XDECREF(__pyx_t_2);
12424 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12425 : __pyx_r = NULL;
12426 0 : __pyx_L0:;
12427 0 : __Pyx_XGIVEREF(__pyx_r);
12428 0 : __Pyx_RefNannyFinishContext();
12429 0 : return __pyx_r;
12430 : }
12431 :
12432 : /* "(tree fragment)":1
12433 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12434 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12435 : * def __setstate_cython__(self, __pyx_state):
12436 : */
12437 :
12438 : /* Python wrapper */
12439 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12440 : #if CYTHON_METH_FASTCALL
12441 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12442 : #else
12443 : PyObject *__pyx_args, PyObject *__pyx_kwds
12444 : #endif
12445 : ); /*proto*/
12446 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12447 : #if CYTHON_METH_FASTCALL
12448 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12449 : #else
12450 : PyObject *__pyx_args, PyObject *__pyx_kwds
12451 : #endif
12452 : ) {
12453 : #if !CYTHON_METH_FASTCALL
12454 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12455 : #endif
12456 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12457 0 : PyObject *__pyx_r = 0;
12458 : __Pyx_RefNannyDeclarations
12459 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12460 : #if !CYTHON_METH_FASTCALL
12461 : #if CYTHON_ASSUME_SAFE_MACROS
12462 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12463 : #else
12464 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12465 : #endif
12466 : #endif
12467 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12468 0 : if (unlikely(__pyx_nargs > 0)) {
12469 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
12470 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
12471 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12472 :
12473 : /* function exit code */
12474 0 : __Pyx_RefNannyFinishContext();
12475 0 : return __pyx_r;
12476 : }
12477 :
12478 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12479 0 : PyObject *__pyx_r = NULL;
12480 : __Pyx_RefNannyDeclarations
12481 0 : int __pyx_lineno = 0;
12482 0 : const char *__pyx_filename = NULL;
12483 0 : int __pyx_clineno = 0;
12484 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
12485 :
12486 : /* "(tree fragment)":2
12487 : * def __reduce_cython__(self):
12488 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12489 : * def __setstate_cython__(self, __pyx_state):
12490 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12491 : */
12492 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
12493 0 : __PYX_ERR(1, 2, __pyx_L1_error)
12494 :
12495 : /* "(tree fragment)":1
12496 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12497 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12498 : * def __setstate_cython__(self, __pyx_state):
12499 : */
12500 :
12501 : /* function exit code */
12502 0 : __pyx_L1_error:;
12503 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12504 0 : __pyx_r = NULL;
12505 0 : __Pyx_XGIVEREF(__pyx_r);
12506 0 : __Pyx_RefNannyFinishContext();
12507 0 : return __pyx_r;
12508 : }
12509 :
12510 : /* "(tree fragment)":3
12511 : * def __reduce_cython__(self):
12512 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12513 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12514 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12515 : */
12516 :
12517 : /* Python wrapper */
12518 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12519 : #if CYTHON_METH_FASTCALL
12520 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12521 : #else
12522 : PyObject *__pyx_args, PyObject *__pyx_kwds
12523 : #endif
12524 : ); /*proto*/
12525 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12526 : #if CYTHON_METH_FASTCALL
12527 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12528 : #else
12529 : PyObject *__pyx_args, PyObject *__pyx_kwds
12530 : #endif
12531 : ) {
12532 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12533 : #if !CYTHON_METH_FASTCALL
12534 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12535 : #endif
12536 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12537 0 : PyObject* values[1] = {0};
12538 0 : int __pyx_lineno = 0;
12539 0 : const char *__pyx_filename = NULL;
12540 0 : int __pyx_clineno = 0;
12541 0 : PyObject *__pyx_r = 0;
12542 : __Pyx_RefNannyDeclarations
12543 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12544 : #if !CYTHON_METH_FASTCALL
12545 : #if CYTHON_ASSUME_SAFE_MACROS
12546 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12547 : #else
12548 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12549 : #endif
12550 : #endif
12551 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12552 0 : {
12553 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
12554 0 : if (__pyx_kwds) {
12555 0 : Py_ssize_t kw_args;
12556 0 : switch (__pyx_nargs) {
12557 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12558 0 : CYTHON_FALLTHROUGH;
12559 0 : case 0: break;
12560 0 : default: goto __pyx_L5_argtuple_error;
12561 : }
12562 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
12563 0 : switch (__pyx_nargs) {
12564 0 : case 0:
12565 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
12566 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
12567 0 : kw_args--;
12568 : }
12569 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
12570 0 : else goto __pyx_L5_argtuple_error;
12571 : }
12572 0 : if (unlikely(kw_args > 0)) {
12573 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
12574 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12575 : }
12576 0 : } else if (unlikely(__pyx_nargs != 1)) {
12577 0 : goto __pyx_L5_argtuple_error;
12578 : } else {
12579 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12580 : }
12581 0 : __pyx_v___pyx_state = values[0];
12582 : }
12583 0 : goto __pyx_L6_skip;
12584 0 : __pyx_L5_argtuple_error:;
12585 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12586 0 : __pyx_L6_skip:;
12587 0 : goto __pyx_L4_argument_unpacking_done;
12588 0 : __pyx_L3_error:;
12589 0 : {
12590 0 : Py_ssize_t __pyx_temp;
12591 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12592 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12593 : }
12594 : }
12595 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12596 : __Pyx_RefNannyFinishContext();
12597 : return NULL;
12598 0 : __pyx_L4_argument_unpacking_done:;
12599 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12600 :
12601 : /* function exit code */
12602 : {
12603 : Py_ssize_t __pyx_temp;
12604 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12605 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12606 : }
12607 : }
12608 : __Pyx_RefNannyFinishContext();
12609 : return __pyx_r;
12610 : }
12611 :
12612 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12613 0 : PyObject *__pyx_r = NULL;
12614 : __Pyx_RefNannyDeclarations
12615 0 : int __pyx_lineno = 0;
12616 0 : const char *__pyx_filename = NULL;
12617 0 : int __pyx_clineno = 0;
12618 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
12619 :
12620 : /* "(tree fragment)":4
12621 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12622 : * def __setstate_cython__(self, __pyx_state):
12623 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12624 : */
12625 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
12626 0 : __PYX_ERR(1, 4, __pyx_L1_error)
12627 :
12628 : /* "(tree fragment)":3
12629 : * def __reduce_cython__(self):
12630 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12631 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12632 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12633 : */
12634 :
12635 : /* function exit code */
12636 0 : __pyx_L1_error:;
12637 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12638 0 : __pyx_r = NULL;
12639 0 : __Pyx_XGIVEREF(__pyx_r);
12640 0 : __Pyx_RefNannyFinishContext();
12641 0 : return __pyx_r;
12642 : }
12643 :
12644 : /* "View.MemoryView":662
12645 : *
12646 : * @cname('__pyx_memoryview_new')
12647 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12648 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12649 : * result.typeinfo = typeinfo
12650 : */
12651 :
12652 10006 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12653 10006 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
12654 10006 : PyObject *__pyx_r = NULL;
12655 : __Pyx_RefNannyDeclarations
12656 10006 : PyObject *__pyx_t_1 = NULL;
12657 10006 : PyObject *__pyx_t_2 = NULL;
12658 10006 : PyObject *__pyx_t_3 = NULL;
12659 10006 : int __pyx_lineno = 0;
12660 10006 : const char *__pyx_filename = NULL;
12661 10006 : int __pyx_clineno = 0;
12662 10006 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
12663 :
12664 : /* "View.MemoryView":663
12665 : * @cname('__pyx_memoryview_new')
12666 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12667 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12668 : * result.typeinfo = typeinfo
12669 : * return result
12670 : */
12671 10006 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
12672 10006 : __Pyx_GOTREF(__pyx_t_1);
12673 10006 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12674 10006 : __Pyx_GOTREF(__pyx_t_2);
12675 10006 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
12676 10006 : __Pyx_GOTREF(__pyx_t_3);
12677 10006 : __Pyx_INCREF(__pyx_v_o);
12678 10006 : __Pyx_GIVEREF(__pyx_v_o);
12679 10006 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
12680 10006 : __Pyx_GIVEREF(__pyx_t_1);
12681 10006 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
12682 10006 : __Pyx_GIVEREF(__pyx_t_2);
12683 10006 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
12684 10006 : __pyx_t_1 = 0;
12685 10006 : __pyx_t_2 = 0;
12686 10006 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12687 10006 : __Pyx_GOTREF(__pyx_t_2);
12688 10006 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12689 10006 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12690 10006 : __pyx_t_2 = 0;
12691 :
12692 : /* "View.MemoryView":664
12693 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12694 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12695 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12696 : * return result
12697 : *
12698 : */
12699 10006 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12700 :
12701 : /* "View.MemoryView":665
12702 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12703 : * result.typeinfo = typeinfo
12704 : * return result # <<<<<<<<<<<<<<
12705 : *
12706 : * @cname('__pyx_memoryview_check')
12707 : */
12708 10006 : __Pyx_XDECREF(__pyx_r);
12709 10006 : __Pyx_INCREF((PyObject *)__pyx_v_result);
12710 10006 : __pyx_r = ((PyObject *)__pyx_v_result);
12711 10006 : goto __pyx_L0;
12712 :
12713 : /* "View.MemoryView":662
12714 : *
12715 : * @cname('__pyx_memoryview_new')
12716 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12717 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12718 : * result.typeinfo = typeinfo
12719 : */
12720 :
12721 : /* function exit code */
12722 0 : __pyx_L1_error:;
12723 0 : __Pyx_XDECREF(__pyx_t_1);
12724 0 : __Pyx_XDECREF(__pyx_t_2);
12725 0 : __Pyx_XDECREF(__pyx_t_3);
12726 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12727 0 : __pyx_r = 0;
12728 10006 : __pyx_L0:;
12729 10006 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
12730 10006 : __Pyx_XGIVEREF(__pyx_r);
12731 10006 : __Pyx_RefNannyFinishContext();
12732 10006 : return __pyx_r;
12733 : }
12734 :
12735 : /* "View.MemoryView":668
12736 : *
12737 : * @cname('__pyx_memoryview_check')
12738 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12739 : * return isinstance(o, memoryview)
12740 : *
12741 : */
12742 :
12743 10006 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12744 10006 : int __pyx_r;
12745 10006 : int __pyx_t_1;
12746 :
12747 : /* "View.MemoryView":669
12748 : * @cname('__pyx_memoryview_check')
12749 : * cdef inline bint memoryview_check(object o) noexcept:
12750 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12751 : *
12752 : * cdef tuple _unellipsify(object index, int ndim):
12753 : */
12754 10006 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12755 10006 : __pyx_r = __pyx_t_1;
12756 10006 : goto __pyx_L0;
12757 :
12758 : /* "View.MemoryView":668
12759 : *
12760 : * @cname('__pyx_memoryview_check')
12761 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12762 : * return isinstance(o, memoryview)
12763 : *
12764 : */
12765 :
12766 : /* function exit code */
12767 10006 : __pyx_L0:;
12768 10006 : return __pyx_r;
12769 : }
12770 :
12771 : /* "View.MemoryView":671
12772 : * return isinstance(o, memoryview)
12773 : *
12774 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12775 : * """
12776 : * Replace all ellipses with full slices and fill incomplete indices with
12777 : */
12778 :
12779 1398 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12780 1398 : Py_ssize_t __pyx_v_idx;
12781 1398 : PyObject *__pyx_v_tup = NULL;
12782 1398 : PyObject *__pyx_v_result = NULL;
12783 1398 : int __pyx_v_have_slices;
12784 1398 : int __pyx_v_seen_ellipsis;
12785 1398 : PyObject *__pyx_v_item = NULL;
12786 1398 : Py_ssize_t __pyx_v_nslices;
12787 1398 : PyObject *__pyx_r = NULL;
12788 : __Pyx_RefNannyDeclarations
12789 1398 : PyObject *__pyx_t_1 = NULL;
12790 1398 : int __pyx_t_2;
12791 1398 : PyObject *__pyx_t_3 = NULL;
12792 1398 : Py_ssize_t __pyx_t_4;
12793 1398 : Py_ssize_t __pyx_t_5;
12794 1398 : Py_UCS4 __pyx_t_6;
12795 1398 : PyObject *__pyx_t_7 = NULL;
12796 1398 : int __pyx_lineno = 0;
12797 1398 : const char *__pyx_filename = NULL;
12798 1398 : int __pyx_clineno = 0;
12799 1398 : __Pyx_RefNannySetupContext("_unellipsify", 1);
12800 :
12801 : /* "View.MemoryView":677
12802 : * """
12803 : * cdef Py_ssize_t idx
12804 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
12805 : *
12806 : * result = [slice(None)] * ndim
12807 : */
12808 1398 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
12809 1398 : if (__pyx_t_2) {
12810 1398 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
12811 : __pyx_t_1 = __pyx_v_index;
12812 : } else {
12813 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
12814 0 : __Pyx_GOTREF(__pyx_t_3);
12815 0 : __Pyx_INCREF(__pyx_v_index);
12816 0 : __Pyx_GIVEREF(__pyx_v_index);
12817 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
12818 0 : __pyx_t_1 = __pyx_t_3;
12819 0 : __pyx_t_3 = 0;
12820 : }
12821 1398 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
12822 1398 : __pyx_t_1 = 0;
12823 :
12824 : /* "View.MemoryView":679
12825 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
12826 : *
12827 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12828 : * have_slices = False
12829 : * seen_ellipsis = False
12830 : */
12831 1398 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
12832 : __Pyx_GOTREF(__pyx_t_1);
12833 : { Py_ssize_t __pyx_temp;
12834 4194 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12835 2796 : __Pyx_INCREF(__pyx_slice__5);
12836 2796 : __Pyx_GIVEREF(__pyx_slice__5);
12837 2796 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
12838 : }
12839 : }
12840 1398 : __pyx_v_result = ((PyObject*)__pyx_t_1);
12841 1398 : __pyx_t_1 = 0;
12842 :
12843 : /* "View.MemoryView":680
12844 : *
12845 : * result = [slice(None)] * ndim
12846 : * have_slices = False # <<<<<<<<<<<<<<
12847 : * seen_ellipsis = False
12848 : * idx = 0
12849 : */
12850 1398 : __pyx_v_have_slices = 0;
12851 :
12852 : /* "View.MemoryView":681
12853 : * result = [slice(None)] * ndim
12854 : * have_slices = False
12855 : * seen_ellipsis = False # <<<<<<<<<<<<<<
12856 : * idx = 0
12857 : * for item in tup:
12858 : */
12859 1398 : __pyx_v_seen_ellipsis = 0;
12860 :
12861 : /* "View.MemoryView":682
12862 : * have_slices = False
12863 : * seen_ellipsis = False
12864 : * idx = 0 # <<<<<<<<<<<<<<
12865 : * for item in tup:
12866 : * if item is Ellipsis:
12867 : */
12868 1398 : __pyx_v_idx = 0;
12869 :
12870 : /* "View.MemoryView":683
12871 : * seen_ellipsis = False
12872 : * idx = 0
12873 : * for item in tup: # <<<<<<<<<<<<<<
12874 : * if item is Ellipsis:
12875 : * if not seen_ellipsis:
12876 : */
12877 1398 : if (unlikely(__pyx_v_tup == Py_None)) {
12878 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
12879 0 : __PYX_ERR(1, 683, __pyx_L1_error)
12880 : }
12881 1398 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
12882 : __pyx_t_4 = 0;
12883 6990 : for (;;) {
12884 4194 : {
12885 4194 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12886 : #if !CYTHON_ASSUME_SAFE_MACROS
12887 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12888 : #endif
12889 4194 : if (__pyx_t_4 >= __pyx_temp) break;
12890 : }
12891 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12892 2796 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12893 : #else
12894 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
12895 : __Pyx_GOTREF(__pyx_t_3);
12896 : #endif
12897 2796 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12898 2796 : __pyx_t_3 = 0;
12899 :
12900 : /* "View.MemoryView":684
12901 : * idx = 0
12902 : * for item in tup:
12903 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12904 : * if not seen_ellipsis:
12905 : * idx += ndim - len(tup)
12906 : */
12907 2796 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12908 2796 : if (__pyx_t_2) {
12909 :
12910 : /* "View.MemoryView":685
12911 : * for item in tup:
12912 : * if item is Ellipsis:
12913 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12914 : * idx += ndim - len(tup)
12915 : * seen_ellipsis = True
12916 : */
12917 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
12918 0 : if (__pyx_t_2) {
12919 :
12920 : /* "View.MemoryView":686
12921 : * if item is Ellipsis:
12922 : * if not seen_ellipsis:
12923 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
12924 : * seen_ellipsis = True
12925 : * have_slices = True
12926 : */
12927 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12928 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12929 : __PYX_ERR(1, 686, __pyx_L1_error)
12930 : }
12931 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
12932 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
12933 :
12934 : /* "View.MemoryView":687
12935 : * if not seen_ellipsis:
12936 : * idx += ndim - len(tup)
12937 : * seen_ellipsis = True # <<<<<<<<<<<<<<
12938 : * have_slices = True
12939 : * else:
12940 : */
12941 0 : __pyx_v_seen_ellipsis = 1;
12942 :
12943 : /* "View.MemoryView":685
12944 : * for item in tup:
12945 : * if item is Ellipsis:
12946 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12947 : * idx += ndim - len(tup)
12948 : * seen_ellipsis = True
12949 : */
12950 : }
12951 :
12952 : /* "View.MemoryView":688
12953 : * idx += ndim - len(tup)
12954 : * seen_ellipsis = True
12955 : * have_slices = True # <<<<<<<<<<<<<<
12956 : * else:
12957 : * if isinstance(item, slice):
12958 : */
12959 0 : __pyx_v_have_slices = 1;
12960 :
12961 : /* "View.MemoryView":684
12962 : * idx = 0
12963 : * for item in tup:
12964 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12965 : * if not seen_ellipsis:
12966 : * idx += ndim - len(tup)
12967 : */
12968 0 : goto __pyx_L5;
12969 : }
12970 :
12971 : /* "View.MemoryView":690
12972 : * have_slices = True
12973 : * else:
12974 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12975 : * have_slices = True
12976 : * elif not PyIndex_Check(item):
12977 : */
12978 2796 : /*else*/ {
12979 2796 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
12980 2796 : if (__pyx_t_2) {
12981 :
12982 : /* "View.MemoryView":691
12983 : * else:
12984 : * if isinstance(item, slice):
12985 : * have_slices = True # <<<<<<<<<<<<<<
12986 : * elif not PyIndex_Check(item):
12987 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12988 : */
12989 1398 : __pyx_v_have_slices = 1;
12990 :
12991 : /* "View.MemoryView":690
12992 : * have_slices = True
12993 : * else:
12994 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12995 : * have_slices = True
12996 : * elif not PyIndex_Check(item):
12997 : */
12998 1398 : goto __pyx_L7;
12999 : }
13000 :
13001 : /* "View.MemoryView":692
13002 : * if isinstance(item, slice):
13003 : * have_slices = True
13004 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
13005 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13006 : * result[idx] = item
13007 : */
13008 1398 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
13009 1398 : if (unlikely(__pyx_t_2)) {
13010 :
13011 : /* "View.MemoryView":693
13012 : * have_slices = True
13013 : * elif not PyIndex_Check(item):
13014 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
13015 : * result[idx] = item
13016 : * idx += 1
13017 : */
13018 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
13019 0 : __Pyx_GOTREF(__pyx_t_3);
13020 0 : __pyx_t_5 = 0;
13021 0 : __pyx_t_6 = 127;
13022 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
13023 0 : __pyx_t_5 += 24;
13024 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
13025 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
13026 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
13027 0 : __Pyx_GOTREF(__pyx_t_7);
13028 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
13029 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
13030 0 : __Pyx_GIVEREF(__pyx_t_7);
13031 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
13032 0 : __pyx_t_7 = 0;
13033 0 : __Pyx_INCREF(__pyx_kp_u__6);
13034 0 : __pyx_t_5 += 1;
13035 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
13036 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
13037 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
13038 0 : __Pyx_GOTREF(__pyx_t_7);
13039 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13040 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
13041 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13042 0 : __PYX_ERR(1, 693, __pyx_L1_error)
13043 :
13044 : /* "View.MemoryView":692
13045 : * if isinstance(item, slice):
13046 : * have_slices = True
13047 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
13048 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13049 : * result[idx] = item
13050 : */
13051 : }
13052 1398 : __pyx_L7:;
13053 :
13054 : /* "View.MemoryView":694
13055 : * elif not PyIndex_Check(item):
13056 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13057 : * result[idx] = item # <<<<<<<<<<<<<<
13058 : * idx += 1
13059 : *
13060 : */
13061 2796 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
13062 : }
13063 2796 : __pyx_L5:;
13064 :
13065 : /* "View.MemoryView":695
13066 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13067 : * result[idx] = item
13068 : * idx += 1 # <<<<<<<<<<<<<<
13069 : *
13070 : * nslices = ndim - idx
13071 : */
13072 2796 : __pyx_v_idx = (__pyx_v_idx + 1);
13073 :
13074 : /* "View.MemoryView":683
13075 : * seen_ellipsis = False
13076 : * idx = 0
13077 : * for item in tup: # <<<<<<<<<<<<<<
13078 : * if item is Ellipsis:
13079 : * if not seen_ellipsis:
13080 : */
13081 2796 : }
13082 1398 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13083 :
13084 : /* "View.MemoryView":697
13085 : * idx += 1
13086 : *
13087 : * nslices = ndim - idx # <<<<<<<<<<<<<<
13088 : * return have_slices or nslices, tuple(result)
13089 : *
13090 : */
13091 1398 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
13092 :
13093 : /* "View.MemoryView":698
13094 : *
13095 : * nslices = ndim - idx
13096 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
13097 : *
13098 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13099 : */
13100 1398 : __Pyx_XDECREF(__pyx_r);
13101 1398 : if (!__pyx_v_have_slices) {
13102 : } else {
13103 1398 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13104 1398 : __Pyx_GOTREF(__pyx_t_7);
13105 1398 : __pyx_t_1 = __pyx_t_7;
13106 1398 : __pyx_t_7 = 0;
13107 1398 : goto __pyx_L9_bool_binop_done;
13108 : }
13109 0 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13110 : __Pyx_GOTREF(__pyx_t_7);
13111 : __pyx_t_1 = __pyx_t_7;
13112 1398 : __pyx_t_7 = 0;
13113 1398 : __pyx_L9_bool_binop_done:;
13114 1398 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13115 1398 : __Pyx_GOTREF(__pyx_t_7);
13116 1398 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
13117 1398 : __Pyx_GOTREF(__pyx_t_3);
13118 1398 : __Pyx_GIVEREF(__pyx_t_1);
13119 1398 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
13120 1398 : __Pyx_GIVEREF(__pyx_t_7);
13121 1398 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
13122 1398 : __pyx_t_1 = 0;
13123 1398 : __pyx_t_7 = 0;
13124 1398 : __pyx_r = ((PyObject*)__pyx_t_3);
13125 1398 : __pyx_t_3 = 0;
13126 1398 : goto __pyx_L0;
13127 :
13128 : /* "View.MemoryView":671
13129 : * return isinstance(o, memoryview)
13130 : *
13131 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13132 : * """
13133 : * Replace all ellipses with full slices and fill incomplete indices with
13134 : */
13135 :
13136 : /* function exit code */
13137 0 : __pyx_L1_error:;
13138 0 : __Pyx_XDECREF(__pyx_t_1);
13139 0 : __Pyx_XDECREF(__pyx_t_3);
13140 0 : __Pyx_XDECREF(__pyx_t_7);
13141 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13142 0 : __pyx_r = 0;
13143 1398 : __pyx_L0:;
13144 1398 : __Pyx_XDECREF(__pyx_v_tup);
13145 1398 : __Pyx_XDECREF(__pyx_v_result);
13146 1398 : __Pyx_XDECREF(__pyx_v_item);
13147 1398 : __Pyx_XGIVEREF(__pyx_r);
13148 1398 : __Pyx_RefNannyFinishContext();
13149 1398 : return __pyx_r;
13150 : }
13151 :
13152 : /* "View.MemoryView":700
13153 : * return have_slices or nslices, tuple(result)
13154 : *
13155 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13156 : * for suboffset in suboffsets[:ndim]:
13157 : * if suboffset >= 0:
13158 : */
13159 :
13160 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13161 0 : Py_ssize_t __pyx_v_suboffset;
13162 0 : int __pyx_r;
13163 0 : Py_ssize_t *__pyx_t_1;
13164 0 : Py_ssize_t *__pyx_t_2;
13165 0 : Py_ssize_t *__pyx_t_3;
13166 0 : int __pyx_t_4;
13167 0 : int __pyx_lineno = 0;
13168 0 : const char *__pyx_filename = NULL;
13169 0 : int __pyx_clineno = 0;
13170 :
13171 : /* "View.MemoryView":701
13172 : *
13173 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13174 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13175 : * if suboffset >= 0:
13176 : * raise ValueError, "Indirect dimensions not supported"
13177 : */
13178 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13179 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13180 0 : __pyx_t_1 = __pyx_t_3;
13181 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
13182 :
13183 : /* "View.MemoryView":702
13184 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13185 : * for suboffset in suboffsets[:ndim]:
13186 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13187 : * raise ValueError, "Indirect dimensions not supported"
13188 : * return 0 # return type just used as an error flag
13189 : */
13190 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
13191 0 : if (unlikely(__pyx_t_4)) {
13192 :
13193 : /* "View.MemoryView":703
13194 : * for suboffset in suboffsets[:ndim]:
13195 : * if suboffset >= 0:
13196 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
13197 : * return 0 # return type just used as an error flag
13198 : *
13199 : */
13200 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
13201 0 : __PYX_ERR(1, 703, __pyx_L1_error)
13202 :
13203 : /* "View.MemoryView":702
13204 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13205 : * for suboffset in suboffsets[:ndim]:
13206 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13207 : * raise ValueError, "Indirect dimensions not supported"
13208 : * return 0 # return type just used as an error flag
13209 : */
13210 : }
13211 : }
13212 :
13213 : /* "View.MemoryView":704
13214 : * if suboffset >= 0:
13215 : * raise ValueError, "Indirect dimensions not supported"
13216 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13217 : *
13218 : *
13219 : */
13220 0 : __pyx_r = 0;
13221 0 : goto __pyx_L0;
13222 :
13223 : /* "View.MemoryView":700
13224 : * return have_slices or nslices, tuple(result)
13225 : *
13226 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13227 : * for suboffset in suboffsets[:ndim]:
13228 : * if suboffset >= 0:
13229 : */
13230 :
13231 : /* function exit code */
13232 0 : __pyx_L1_error:;
13233 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13234 0 : __pyx_r = -1;
13235 0 : __pyx_L0:;
13236 0 : return __pyx_r;
13237 : }
13238 :
13239 : /* "View.MemoryView":711
13240 : *
13241 : * @cname('__pyx_memview_slice')
13242 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13243 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13244 : * cdef bint negative_step
13245 : */
13246 :
13247 1398 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13248 1398 : int __pyx_v_new_ndim;
13249 1398 : int __pyx_v_suboffset_dim;
13250 1398 : int __pyx_v_dim;
13251 1398 : __Pyx_memviewslice __pyx_v_src;
13252 1398 : __Pyx_memviewslice __pyx_v_dst;
13253 1398 : __Pyx_memviewslice *__pyx_v_p_src;
13254 1398 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13255 1398 : __Pyx_memviewslice *__pyx_v_p_dst;
13256 1398 : int *__pyx_v_p_suboffset_dim;
13257 1398 : Py_ssize_t __pyx_v_start;
13258 1398 : Py_ssize_t __pyx_v_stop;
13259 1398 : Py_ssize_t __pyx_v_step;
13260 1398 : Py_ssize_t __pyx_v_cindex;
13261 1398 : int __pyx_v_have_start;
13262 1398 : int __pyx_v_have_stop;
13263 1398 : int __pyx_v_have_step;
13264 1398 : PyObject *__pyx_v_index = NULL;
13265 1398 : struct __pyx_memoryview_obj *__pyx_r = NULL;
13266 : __Pyx_RefNannyDeclarations
13267 1398 : int __pyx_t_1;
13268 1398 : PyObject *__pyx_t_2 = NULL;
13269 1398 : struct __pyx_memoryview_obj *__pyx_t_3;
13270 1398 : char *__pyx_t_4;
13271 1398 : int __pyx_t_5;
13272 1398 : Py_ssize_t __pyx_t_6;
13273 1398 : PyObject *(*__pyx_t_7)(PyObject *);
13274 1398 : PyObject *__pyx_t_8 = NULL;
13275 1398 : Py_ssize_t __pyx_t_9;
13276 1398 : int __pyx_t_10;
13277 1398 : Py_ssize_t __pyx_t_11;
13278 1398 : int __pyx_lineno = 0;
13279 1398 : const char *__pyx_filename = NULL;
13280 1398 : int __pyx_clineno = 0;
13281 1398 : __Pyx_RefNannySetupContext("memview_slice", 1);
13282 :
13283 : /* "View.MemoryView":712
13284 : * @cname('__pyx_memview_slice')
13285 : * cdef memoryview memview_slice(memoryview memview, object indices):
13286 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13287 : * cdef bint negative_step
13288 : * cdef __Pyx_memviewslice src, dst
13289 : */
13290 1398 : __pyx_v_new_ndim = 0;
13291 1398 : __pyx_v_suboffset_dim = -1;
13292 :
13293 : /* "View.MemoryView":719
13294 : *
13295 : *
13296 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13297 : *
13298 : * cdef _memoryviewslice memviewsliceobj
13299 : */
13300 1398 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13301 :
13302 : /* "View.MemoryView":723
13303 : * cdef _memoryviewslice memviewsliceobj
13304 : *
13305 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13306 : *
13307 : * if isinstance(memview, _memoryviewslice):
13308 : */
13309 : #ifndef CYTHON_WITHOUT_ASSERTIONS
13310 1398 : if (unlikely(__pyx_assertions_enabled())) {
13311 1398 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13312 1398 : if (unlikely(!__pyx_t_1)) {
13313 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
13314 0 : __PYX_ERR(1, 723, __pyx_L1_error)
13315 : }
13316 : }
13317 : #else
13318 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
13319 : #endif
13320 :
13321 : /* "View.MemoryView":725
13322 : * assert memview.view.ndim > 0
13323 : *
13324 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13325 : * memviewsliceobj = memview
13326 : * p_src = &memviewsliceobj.from_slice
13327 : */
13328 1398 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13329 1398 : if (__pyx_t_1) {
13330 :
13331 : /* "View.MemoryView":726
13332 : *
13333 : * if isinstance(memview, _memoryviewslice):
13334 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
13335 : * p_src = &memviewsliceobj.from_slice
13336 : * else:
13337 : */
13338 1398 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
13339 1398 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13340 1398 : __Pyx_INCREF(__pyx_t_2);
13341 1398 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13342 1398 : __pyx_t_2 = 0;
13343 :
13344 : /* "View.MemoryView":727
13345 : * if isinstance(memview, _memoryviewslice):
13346 : * memviewsliceobj = memview
13347 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13348 : * else:
13349 : * slice_copy(memview, &src)
13350 : */
13351 1398 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13352 :
13353 : /* "View.MemoryView":725
13354 : * assert memview.view.ndim > 0
13355 : *
13356 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13357 : * memviewsliceobj = memview
13358 : * p_src = &memviewsliceobj.from_slice
13359 : */
13360 1398 : goto __pyx_L3;
13361 : }
13362 :
13363 : /* "View.MemoryView":729
13364 : * p_src = &memviewsliceobj.from_slice
13365 : * else:
13366 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13367 : * p_src = &src
13368 : *
13369 : */
13370 0 : /*else*/ {
13371 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13372 :
13373 : /* "View.MemoryView":730
13374 : * else:
13375 : * slice_copy(memview, &src)
13376 : * p_src = &src # <<<<<<<<<<<<<<
13377 : *
13378 : *
13379 : */
13380 0 : __pyx_v_p_src = (&__pyx_v_src);
13381 : }
13382 1398 : __pyx_L3:;
13383 :
13384 : /* "View.MemoryView":736
13385 : *
13386 : *
13387 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13388 : * dst.data = p_src.data
13389 : *
13390 : */
13391 1398 : __pyx_t_3 = __pyx_v_p_src->memview;
13392 1398 : __pyx_v_dst.memview = __pyx_t_3;
13393 :
13394 : /* "View.MemoryView":737
13395 : *
13396 : * dst.memview = p_src.memview
13397 : * dst.data = p_src.data # <<<<<<<<<<<<<<
13398 : *
13399 : *
13400 : */
13401 1398 : __pyx_t_4 = __pyx_v_p_src->data;
13402 1398 : __pyx_v_dst.data = __pyx_t_4;
13403 :
13404 : /* "View.MemoryView":742
13405 : *
13406 : *
13407 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13408 : * cdef int *p_suboffset_dim = &suboffset_dim
13409 : * cdef Py_ssize_t start, stop, step, cindex
13410 : */
13411 1398 : __pyx_v_p_dst = (&__pyx_v_dst);
13412 :
13413 : /* "View.MemoryView":743
13414 : *
13415 : * cdef __Pyx_memviewslice *p_dst = &dst
13416 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13417 : * cdef Py_ssize_t start, stop, step, cindex
13418 : * cdef bint have_start, have_stop, have_step
13419 : */
13420 1398 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13421 :
13422 : /* "View.MemoryView":747
13423 : * cdef bint have_start, have_stop, have_step
13424 : *
13425 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13426 : * if PyIndex_Check(index):
13427 : * cindex = index
13428 : */
13429 1398 : __pyx_t_5 = 0;
13430 1398 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13431 1398 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13432 1398 : __pyx_t_6 = 0;
13433 1398 : __pyx_t_7 = NULL;
13434 : } else {
13435 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
13436 0 : __Pyx_GOTREF(__pyx_t_2);
13437 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
13438 : }
13439 4194 : for (;;) {
13440 4194 : if (likely(!__pyx_t_7)) {
13441 4194 : if (likely(PyList_CheckExact(__pyx_t_2))) {
13442 0 : {
13443 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
13444 : #if !CYTHON_ASSUME_SAFE_MACROS
13445 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13446 : #endif
13447 0 : if (__pyx_t_6 >= __pyx_temp) break;
13448 : }
13449 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13450 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13451 : #else
13452 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
13453 : __Pyx_GOTREF(__pyx_t_8);
13454 : #endif
13455 : } else {
13456 4194 : {
13457 4194 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13458 : #if !CYTHON_ASSUME_SAFE_MACROS
13459 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13460 : #endif
13461 4194 : if (__pyx_t_6 >= __pyx_temp) break;
13462 : }
13463 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13464 4194 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13465 : #else
13466 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
13467 : __Pyx_GOTREF(__pyx_t_8);
13468 : #endif
13469 : }
13470 : } else {
13471 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
13472 0 : if (unlikely(!__pyx_t_8)) {
13473 0 : PyObject* exc_type = PyErr_Occurred();
13474 0 : if (exc_type) {
13475 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13476 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
13477 : }
13478 : break;
13479 : }
13480 2796 : __Pyx_GOTREF(__pyx_t_8);
13481 : }
13482 2796 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
13483 2796 : __pyx_t_8 = 0;
13484 2796 : __pyx_v_dim = __pyx_t_5;
13485 2796 : __pyx_t_5 = (__pyx_t_5 + 1);
13486 :
13487 : /* "View.MemoryView":748
13488 : *
13489 : * for dim, index in enumerate(indices):
13490 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13491 : * cindex = index
13492 : * slice_memviewslice(
13493 : */
13494 2796 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13495 2796 : if (__pyx_t_1) {
13496 :
13497 : /* "View.MemoryView":749
13498 : * for dim, index in enumerate(indices):
13499 : * if PyIndex_Check(index):
13500 : * cindex = index # <<<<<<<<<<<<<<
13501 : * slice_memviewslice(
13502 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13503 : */
13504 1398 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
13505 1398 : __pyx_v_cindex = __pyx_t_9;
13506 :
13507 : /* "View.MemoryView":750
13508 : * if PyIndex_Check(index):
13509 : * cindex = index
13510 : * slice_memviewslice( # <<<<<<<<<<<<<<
13511 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13512 : * dim, new_ndim, p_suboffset_dim,
13513 : */
13514 1398 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
13515 :
13516 : /* "View.MemoryView":748
13517 : *
13518 : * for dim, index in enumerate(indices):
13519 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13520 : * cindex = index
13521 : * slice_memviewslice(
13522 : */
13523 1398 : goto __pyx_L6;
13524 : }
13525 :
13526 : /* "View.MemoryView":756
13527 : * 0, 0, 0, # have_{start,stop,step}
13528 : * False)
13529 : * elif index is None: # <<<<<<<<<<<<<<
13530 : * p_dst.shape[new_ndim] = 1
13531 : * p_dst.strides[new_ndim] = 0
13532 : */
13533 1398 : __pyx_t_1 = (__pyx_v_index == Py_None);
13534 1398 : if (__pyx_t_1) {
13535 :
13536 : /* "View.MemoryView":757
13537 : * False)
13538 : * elif index is None:
13539 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13540 : * p_dst.strides[new_ndim] = 0
13541 : * p_dst.suboffsets[new_ndim] = -1
13542 : */
13543 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13544 :
13545 : /* "View.MemoryView":758
13546 : * elif index is None:
13547 : * p_dst.shape[new_ndim] = 1
13548 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13549 : * p_dst.suboffsets[new_ndim] = -1
13550 : * new_ndim += 1
13551 : */
13552 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13553 :
13554 : /* "View.MemoryView":759
13555 : * p_dst.shape[new_ndim] = 1
13556 : * p_dst.strides[new_ndim] = 0
13557 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13558 : * new_ndim += 1
13559 : * else:
13560 : */
13561 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13562 :
13563 : /* "View.MemoryView":760
13564 : * p_dst.strides[new_ndim] = 0
13565 : * p_dst.suboffsets[new_ndim] = -1
13566 : * new_ndim += 1 # <<<<<<<<<<<<<<
13567 : * else:
13568 : * start = index.start or 0
13569 : */
13570 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13571 :
13572 : /* "View.MemoryView":756
13573 : * 0, 0, 0, # have_{start,stop,step}
13574 : * False)
13575 : * elif index is None: # <<<<<<<<<<<<<<
13576 : * p_dst.shape[new_ndim] = 1
13577 : * p_dst.strides[new_ndim] = 0
13578 : */
13579 0 : goto __pyx_L6;
13580 : }
13581 :
13582 : /* "View.MemoryView":762
13583 : * new_ndim += 1
13584 : * else:
13585 : * start = index.start or 0 # <<<<<<<<<<<<<<
13586 : * stop = index.stop or 0
13587 : * step = index.step or 0
13588 : */
13589 1398 : /*else*/ {
13590 1398 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
13591 1398 : __Pyx_GOTREF(__pyx_t_8);
13592 1398 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
13593 1398 : if (!__pyx_t_1) {
13594 1398 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13595 : } else {
13596 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
13597 0 : __pyx_t_9 = __pyx_t_11;
13598 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13599 0 : goto __pyx_L7_bool_binop_done;
13600 : }
13601 : __pyx_t_9 = 0;
13602 1398 : __pyx_L7_bool_binop_done:;
13603 1398 : __pyx_v_start = __pyx_t_9;
13604 :
13605 : /* "View.MemoryView":763
13606 : * else:
13607 : * start = index.start or 0
13608 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
13609 : * step = index.step or 0
13610 : *
13611 : */
13612 1398 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
13613 1398 : __Pyx_GOTREF(__pyx_t_8);
13614 1398 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
13615 1398 : if (!__pyx_t_1) {
13616 1398 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13617 : } else {
13618 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
13619 0 : __pyx_t_9 = __pyx_t_11;
13620 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13621 0 : goto __pyx_L9_bool_binop_done;
13622 : }
13623 : __pyx_t_9 = 0;
13624 1398 : __pyx_L9_bool_binop_done:;
13625 1398 : __pyx_v_stop = __pyx_t_9;
13626 :
13627 : /* "View.MemoryView":764
13628 : * start = index.start or 0
13629 : * stop = index.stop or 0
13630 : * step = index.step or 0 # <<<<<<<<<<<<<<
13631 : *
13632 : * have_start = index.start is not None
13633 : */
13634 1398 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
13635 1398 : __Pyx_GOTREF(__pyx_t_8);
13636 1398 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
13637 1398 : if (!__pyx_t_1) {
13638 1398 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13639 : } else {
13640 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
13641 0 : __pyx_t_9 = __pyx_t_11;
13642 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13643 0 : goto __pyx_L11_bool_binop_done;
13644 : }
13645 : __pyx_t_9 = 0;
13646 1398 : __pyx_L11_bool_binop_done:;
13647 1398 : __pyx_v_step = __pyx_t_9;
13648 :
13649 : /* "View.MemoryView":766
13650 : * step = index.step or 0
13651 : *
13652 : * have_start = index.start is not None # <<<<<<<<<<<<<<
13653 : * have_stop = index.stop is not None
13654 : * have_step = index.step is not None
13655 : */
13656 1398 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
13657 1398 : __Pyx_GOTREF(__pyx_t_8);
13658 1398 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13659 1398 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13660 1398 : __pyx_v_have_start = __pyx_t_1;
13661 :
13662 : /* "View.MemoryView":767
13663 : *
13664 : * have_start = index.start is not None
13665 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13666 : * have_step = index.step is not None
13667 : *
13668 : */
13669 1398 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
13670 1398 : __Pyx_GOTREF(__pyx_t_8);
13671 1398 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13672 1398 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13673 1398 : __pyx_v_have_stop = __pyx_t_1;
13674 :
13675 : /* "View.MemoryView":768
13676 : * have_start = index.start is not None
13677 : * have_stop = index.stop is not None
13678 : * have_step = index.step is not None # <<<<<<<<<<<<<<
13679 : *
13680 : * slice_memviewslice(
13681 : */
13682 1398 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
13683 1398 : __Pyx_GOTREF(__pyx_t_8);
13684 1398 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13685 1398 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13686 1398 : __pyx_v_have_step = __pyx_t_1;
13687 :
13688 : /* "View.MemoryView":770
13689 : * have_step = index.step is not None
13690 : *
13691 : * slice_memviewslice( # <<<<<<<<<<<<<<
13692 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13693 : * dim, new_ndim, p_suboffset_dim,
13694 : */
13695 1398 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
13696 :
13697 : /* "View.MemoryView":776
13698 : * have_start, have_stop, have_step,
13699 : * True)
13700 : * new_ndim += 1 # <<<<<<<<<<<<<<
13701 : *
13702 : * if isinstance(memview, _memoryviewslice):
13703 : */
13704 1398 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13705 : }
13706 1398 : __pyx_L6:;
13707 :
13708 : /* "View.MemoryView":747
13709 : * cdef bint have_start, have_stop, have_step
13710 : *
13711 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13712 : * if PyIndex_Check(index):
13713 : * cindex = index
13714 : */
13715 : }
13716 1398 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13717 :
13718 : /* "View.MemoryView":778
13719 : * new_ndim += 1
13720 : *
13721 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13722 : * return memoryview_fromslice(dst, new_ndim,
13723 : * memviewsliceobj.to_object_func,
13724 : */
13725 1398 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13726 1398 : if (__pyx_t_1) {
13727 :
13728 : /* "View.MemoryView":779
13729 : *
13730 : * if isinstance(memview, _memoryviewslice):
13731 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13732 : * memviewsliceobj.to_object_func,
13733 : * memviewsliceobj.to_dtype_func,
13734 : */
13735 1398 : __Pyx_XDECREF((PyObject *)__pyx_r);
13736 :
13737 : /* "View.MemoryView":780
13738 : * if isinstance(memview, _memoryviewslice):
13739 : * return memoryview_fromslice(dst, new_ndim,
13740 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13741 : * memviewsliceobj.to_dtype_func,
13742 : * memview.dtype_is_object)
13743 : */
13744 1398 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
13745 :
13746 : /* "View.MemoryView":781
13747 : * return memoryview_fromslice(dst, new_ndim,
13748 : * memviewsliceobj.to_object_func,
13749 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
13750 : * memview.dtype_is_object)
13751 : * else:
13752 : */
13753 1398 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
13754 :
13755 : /* "View.MemoryView":779
13756 : *
13757 : * if isinstance(memview, _memoryviewslice):
13758 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13759 : * memviewsliceobj.to_object_func,
13760 : * memviewsliceobj.to_dtype_func,
13761 : */
13762 1398 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
13763 1398 : __Pyx_GOTREF(__pyx_t_2);
13764 1398 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
13765 1398 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13766 1398 : __pyx_t_2 = 0;
13767 1398 : goto __pyx_L0;
13768 :
13769 : /* "View.MemoryView":778
13770 : * new_ndim += 1
13771 : *
13772 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13773 : * return memoryview_fromslice(dst, new_ndim,
13774 : * memviewsliceobj.to_object_func,
13775 : */
13776 : }
13777 :
13778 : /* "View.MemoryView":784
13779 : * memview.dtype_is_object)
13780 : * else:
13781 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13782 : * memview.dtype_is_object)
13783 : *
13784 : */
13785 0 : /*else*/ {
13786 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13787 :
13788 : /* "View.MemoryView":785
13789 : * else:
13790 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13791 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
13792 : *
13793 : *
13794 : */
13795 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
13796 0 : __Pyx_GOTREF(__pyx_t_2);
13797 :
13798 : /* "View.MemoryView":784
13799 : * memview.dtype_is_object)
13800 : * else:
13801 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13802 : * memview.dtype_is_object)
13803 : *
13804 : */
13805 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
13806 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13807 0 : __pyx_t_2 = 0;
13808 0 : goto __pyx_L0;
13809 : }
13810 :
13811 : /* "View.MemoryView":711
13812 : *
13813 : * @cname('__pyx_memview_slice')
13814 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13815 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13816 : * cdef bint negative_step
13817 : */
13818 :
13819 : /* function exit code */
13820 0 : __pyx_L1_error:;
13821 0 : __Pyx_XDECREF(__pyx_t_2);
13822 0 : __Pyx_XDECREF(__pyx_t_8);
13823 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13824 : __pyx_r = 0;
13825 1398 : __pyx_L0:;
13826 1398 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13827 1398 : __Pyx_XDECREF(__pyx_v_index);
13828 1398 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
13829 1398 : __Pyx_RefNannyFinishContext();
13830 1398 : return __pyx_r;
13831 : }
13832 :
13833 : /* "View.MemoryView":793
13834 : *
13835 : * @cname('__pyx_memoryview_slice_memviewslice')
13836 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13837 : * __Pyx_memviewslice *dst,
13838 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13839 : */
13840 :
13841 2796 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
13842 2796 : Py_ssize_t __pyx_v_new_shape;
13843 2796 : int __pyx_v_negative_step;
13844 2796 : int __pyx_r;
13845 2796 : int __pyx_t_1;
13846 2796 : int __pyx_t_2;
13847 2796 : int __pyx_t_3;
13848 2796 : int __pyx_lineno = 0;
13849 2796 : const char *__pyx_filename = NULL;
13850 2796 : int __pyx_clineno = 0;
13851 : #ifdef WITH_THREAD
13852 2796 : PyGILState_STATE __pyx_gilstate_save;
13853 : #endif
13854 :
13855 : /* "View.MemoryView":813
13856 : * cdef bint negative_step
13857 : *
13858 : * if not is_slice: # <<<<<<<<<<<<<<
13859 : *
13860 : * if start < 0:
13861 : */
13862 2796 : __pyx_t_1 = (!__pyx_v_is_slice);
13863 2796 : if (__pyx_t_1) {
13864 :
13865 : /* "View.MemoryView":815
13866 : * if not is_slice:
13867 : *
13868 : * if start < 0: # <<<<<<<<<<<<<<
13869 : * start += shape
13870 : * if not 0 <= start < shape:
13871 : */
13872 1398 : __pyx_t_1 = (__pyx_v_start < 0);
13873 1398 : if (__pyx_t_1) {
13874 :
13875 : /* "View.MemoryView":816
13876 : *
13877 : * if start < 0:
13878 : * start += shape # <<<<<<<<<<<<<<
13879 : * if not 0 <= start < shape:
13880 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13881 : */
13882 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13883 :
13884 : /* "View.MemoryView":815
13885 : * if not is_slice:
13886 : *
13887 : * if start < 0: # <<<<<<<<<<<<<<
13888 : * start += shape
13889 : * if not 0 <= start < shape:
13890 : */
13891 : }
13892 :
13893 : /* "View.MemoryView":817
13894 : * if start < 0:
13895 : * start += shape
13896 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13897 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13898 : * else:
13899 : */
13900 1398 : __pyx_t_1 = (0 <= __pyx_v_start);
13901 0 : if (__pyx_t_1) {
13902 1398 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13903 : }
13904 1398 : __pyx_t_2 = (!__pyx_t_1);
13905 1398 : if (__pyx_t_2) {
13906 :
13907 : /* "View.MemoryView":818
13908 : * start += shape
13909 : * if not 0 <= start < shape:
13910 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
13911 : * else:
13912 : *
13913 : */
13914 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
13915 :
13916 : /* "View.MemoryView":817
13917 : * if start < 0:
13918 : * start += shape
13919 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13920 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13921 : * else:
13922 : */
13923 : }
13924 :
13925 : /* "View.MemoryView":813
13926 : * cdef bint negative_step
13927 : *
13928 : * if not is_slice: # <<<<<<<<<<<<<<
13929 : *
13930 : * if start < 0:
13931 : */
13932 1398 : goto __pyx_L3;
13933 : }
13934 :
13935 : /* "View.MemoryView":821
13936 : * else:
13937 : *
13938 : * if have_step: # <<<<<<<<<<<<<<
13939 : * negative_step = step < 0
13940 : * if step == 0:
13941 : */
13942 1398 : /*else*/ {
13943 1398 : __pyx_t_2 = (__pyx_v_have_step != 0);
13944 1398 : if (__pyx_t_2) {
13945 :
13946 : /* "View.MemoryView":822
13947 : *
13948 : * if have_step:
13949 : * negative_step = step < 0 # <<<<<<<<<<<<<<
13950 : * if step == 0:
13951 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13952 : */
13953 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
13954 :
13955 : /* "View.MemoryView":823
13956 : * if have_step:
13957 : * negative_step = step < 0
13958 : * if step == 0: # <<<<<<<<<<<<<<
13959 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13960 : * else:
13961 : */
13962 0 : __pyx_t_2 = (__pyx_v_step == 0);
13963 0 : if (__pyx_t_2) {
13964 :
13965 : /* "View.MemoryView":824
13966 : * negative_step = step < 0
13967 : * if step == 0:
13968 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
13969 : * else:
13970 : * negative_step = False
13971 : */
13972 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
13973 :
13974 : /* "View.MemoryView":823
13975 : * if have_step:
13976 : * negative_step = step < 0
13977 : * if step == 0: # <<<<<<<<<<<<<<
13978 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13979 : * else:
13980 : */
13981 : }
13982 :
13983 : /* "View.MemoryView":821
13984 : * else:
13985 : *
13986 : * if have_step: # <<<<<<<<<<<<<<
13987 : * negative_step = step < 0
13988 : * if step == 0:
13989 : */
13990 0 : goto __pyx_L6;
13991 : }
13992 :
13993 : /* "View.MemoryView":826
13994 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13995 : * else:
13996 : * negative_step = False # <<<<<<<<<<<<<<
13997 : * step = 1
13998 : *
13999 : */
14000 : /*else*/ {
14001 : __pyx_v_negative_step = 0;
14002 :
14003 : /* "View.MemoryView":827
14004 : * else:
14005 : * negative_step = False
14006 : * step = 1 # <<<<<<<<<<<<<<
14007 : *
14008 : *
14009 : */
14010 : __pyx_v_step = 1;
14011 : }
14012 1398 : __pyx_L6:;
14013 :
14014 : /* "View.MemoryView":830
14015 : *
14016 : *
14017 : * if have_start: # <<<<<<<<<<<<<<
14018 : * if start < 0:
14019 : * start += shape
14020 : */
14021 1398 : __pyx_t_2 = (__pyx_v_have_start != 0);
14022 1398 : if (__pyx_t_2) {
14023 :
14024 : /* "View.MemoryView":831
14025 : *
14026 : * if have_start:
14027 : * if start < 0: # <<<<<<<<<<<<<<
14028 : * start += shape
14029 : * if start < 0:
14030 : */
14031 0 : __pyx_t_2 = (__pyx_v_start < 0);
14032 0 : if (__pyx_t_2) {
14033 :
14034 : /* "View.MemoryView":832
14035 : * if have_start:
14036 : * if start < 0:
14037 : * start += shape # <<<<<<<<<<<<<<
14038 : * if start < 0:
14039 : * start = 0
14040 : */
14041 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14042 :
14043 : /* "View.MemoryView":833
14044 : * if start < 0:
14045 : * start += shape
14046 : * if start < 0: # <<<<<<<<<<<<<<
14047 : * start = 0
14048 : * elif start >= shape:
14049 : */
14050 0 : __pyx_t_2 = (__pyx_v_start < 0);
14051 0 : if (__pyx_t_2) {
14052 :
14053 : /* "View.MemoryView":834
14054 : * start += shape
14055 : * if start < 0:
14056 : * start = 0 # <<<<<<<<<<<<<<
14057 : * elif start >= shape:
14058 : * if negative_step:
14059 : */
14060 : __pyx_v_start = 0;
14061 :
14062 : /* "View.MemoryView":833
14063 : * if start < 0:
14064 : * start += shape
14065 : * if start < 0: # <<<<<<<<<<<<<<
14066 : * start = 0
14067 : * elif start >= shape:
14068 : */
14069 : }
14070 :
14071 : /* "View.MemoryView":831
14072 : *
14073 : * if have_start:
14074 : * if start < 0: # <<<<<<<<<<<<<<
14075 : * start += shape
14076 : * if start < 0:
14077 : */
14078 0 : goto __pyx_L9;
14079 : }
14080 :
14081 : /* "View.MemoryView":835
14082 : * if start < 0:
14083 : * start = 0
14084 : * elif start >= shape: # <<<<<<<<<<<<<<
14085 : * if negative_step:
14086 : * start = shape - 1
14087 : */
14088 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
14089 0 : if (__pyx_t_2) {
14090 :
14091 : /* "View.MemoryView":836
14092 : * start = 0
14093 : * elif start >= shape:
14094 : * if negative_step: # <<<<<<<<<<<<<<
14095 : * start = shape - 1
14096 : * else:
14097 : */
14098 0 : if (__pyx_v_negative_step) {
14099 :
14100 : /* "View.MemoryView":837
14101 : * elif start >= shape:
14102 : * if negative_step:
14103 : * start = shape - 1 # <<<<<<<<<<<<<<
14104 : * else:
14105 : * start = shape
14106 : */
14107 0 : __pyx_v_start = (__pyx_v_shape - 1);
14108 :
14109 : /* "View.MemoryView":836
14110 : * start = 0
14111 : * elif start >= shape:
14112 : * if negative_step: # <<<<<<<<<<<<<<
14113 : * start = shape - 1
14114 : * else:
14115 : */
14116 0 : goto __pyx_L11;
14117 : }
14118 :
14119 : /* "View.MemoryView":839
14120 : * start = shape - 1
14121 : * else:
14122 : * start = shape # <<<<<<<<<<<<<<
14123 : * else:
14124 : * if negative_step:
14125 : */
14126 : /*else*/ {
14127 : __pyx_v_start = __pyx_v_shape;
14128 : }
14129 0 : __pyx_L11:;
14130 :
14131 : /* "View.MemoryView":835
14132 : * if start < 0:
14133 : * start = 0
14134 : * elif start >= shape: # <<<<<<<<<<<<<<
14135 : * if negative_step:
14136 : * start = shape - 1
14137 : */
14138 : }
14139 0 : __pyx_L9:;
14140 :
14141 : /* "View.MemoryView":830
14142 : *
14143 : *
14144 : * if have_start: # <<<<<<<<<<<<<<
14145 : * if start < 0:
14146 : * start += shape
14147 : */
14148 0 : goto __pyx_L8;
14149 : }
14150 :
14151 : /* "View.MemoryView":841
14152 : * start = shape
14153 : * else:
14154 : * if negative_step: # <<<<<<<<<<<<<<
14155 : * start = shape - 1
14156 : * else:
14157 : */
14158 1398 : /*else*/ {
14159 1398 : if (__pyx_v_negative_step) {
14160 :
14161 : /* "View.MemoryView":842
14162 : * else:
14163 : * if negative_step:
14164 : * start = shape - 1 # <<<<<<<<<<<<<<
14165 : * else:
14166 : * start = 0
14167 : */
14168 0 : __pyx_v_start = (__pyx_v_shape - 1);
14169 :
14170 : /* "View.MemoryView":841
14171 : * start = shape
14172 : * else:
14173 : * if negative_step: # <<<<<<<<<<<<<<
14174 : * start = shape - 1
14175 : * else:
14176 : */
14177 0 : goto __pyx_L12;
14178 : }
14179 :
14180 : /* "View.MemoryView":844
14181 : * start = shape - 1
14182 : * else:
14183 : * start = 0 # <<<<<<<<<<<<<<
14184 : *
14185 : * if have_stop:
14186 : */
14187 : /*else*/ {
14188 : __pyx_v_start = 0;
14189 : }
14190 1398 : __pyx_L12:;
14191 : }
14192 1398 : __pyx_L8:;
14193 :
14194 : /* "View.MemoryView":846
14195 : * start = 0
14196 : *
14197 : * if have_stop: # <<<<<<<<<<<<<<
14198 : * if stop < 0:
14199 : * stop += shape
14200 : */
14201 1398 : __pyx_t_2 = (__pyx_v_have_stop != 0);
14202 1398 : if (__pyx_t_2) {
14203 :
14204 : /* "View.MemoryView":847
14205 : *
14206 : * if have_stop:
14207 : * if stop < 0: # <<<<<<<<<<<<<<
14208 : * stop += shape
14209 : * if stop < 0:
14210 : */
14211 0 : __pyx_t_2 = (__pyx_v_stop < 0);
14212 0 : if (__pyx_t_2) {
14213 :
14214 : /* "View.MemoryView":848
14215 : * if have_stop:
14216 : * if stop < 0:
14217 : * stop += shape # <<<<<<<<<<<<<<
14218 : * if stop < 0:
14219 : * stop = 0
14220 : */
14221 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14222 :
14223 : /* "View.MemoryView":849
14224 : * if stop < 0:
14225 : * stop += shape
14226 : * if stop < 0: # <<<<<<<<<<<<<<
14227 : * stop = 0
14228 : * elif stop > shape:
14229 : */
14230 0 : __pyx_t_2 = (__pyx_v_stop < 0);
14231 0 : if (__pyx_t_2) {
14232 :
14233 : /* "View.MemoryView":850
14234 : * stop += shape
14235 : * if stop < 0:
14236 : * stop = 0 # <<<<<<<<<<<<<<
14237 : * elif stop > shape:
14238 : * stop = shape
14239 : */
14240 : __pyx_v_stop = 0;
14241 :
14242 : /* "View.MemoryView":849
14243 : * if stop < 0:
14244 : * stop += shape
14245 : * if stop < 0: # <<<<<<<<<<<<<<
14246 : * stop = 0
14247 : * elif stop > shape:
14248 : */
14249 : }
14250 :
14251 : /* "View.MemoryView":847
14252 : *
14253 : * if have_stop:
14254 : * if stop < 0: # <<<<<<<<<<<<<<
14255 : * stop += shape
14256 : * if stop < 0:
14257 : */
14258 0 : goto __pyx_L14;
14259 : }
14260 :
14261 : /* "View.MemoryView":851
14262 : * if stop < 0:
14263 : * stop = 0
14264 : * elif stop > shape: # <<<<<<<<<<<<<<
14265 : * stop = shape
14266 : * else:
14267 : */
14268 0 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
14269 0 : if (__pyx_t_2) {
14270 :
14271 : /* "View.MemoryView":852
14272 : * stop = 0
14273 : * elif stop > shape:
14274 : * stop = shape # <<<<<<<<<<<<<<
14275 : * else:
14276 : * if negative_step:
14277 : */
14278 : __pyx_v_stop = __pyx_v_shape;
14279 :
14280 : /* "View.MemoryView":851
14281 : * if stop < 0:
14282 : * stop = 0
14283 : * elif stop > shape: # <<<<<<<<<<<<<<
14284 : * stop = shape
14285 : * else:
14286 : */
14287 : }
14288 0 : __pyx_L14:;
14289 :
14290 : /* "View.MemoryView":846
14291 : * start = 0
14292 : *
14293 : * if have_stop: # <<<<<<<<<<<<<<
14294 : * if stop < 0:
14295 : * stop += shape
14296 : */
14297 0 : goto __pyx_L13;
14298 : }
14299 :
14300 : /* "View.MemoryView":854
14301 : * stop = shape
14302 : * else:
14303 : * if negative_step: # <<<<<<<<<<<<<<
14304 : * stop = -1
14305 : * else:
14306 : */
14307 1398 : /*else*/ {
14308 1398 : if (__pyx_v_negative_step) {
14309 :
14310 : /* "View.MemoryView":855
14311 : * else:
14312 : * if negative_step:
14313 : * stop = -1 # <<<<<<<<<<<<<<
14314 : * else:
14315 : * stop = shape
14316 : */
14317 0 : __pyx_v_stop = -1L;
14318 :
14319 : /* "View.MemoryView":854
14320 : * stop = shape
14321 : * else:
14322 : * if negative_step: # <<<<<<<<<<<<<<
14323 : * stop = -1
14324 : * else:
14325 : */
14326 0 : goto __pyx_L16;
14327 : }
14328 :
14329 : /* "View.MemoryView":857
14330 : * stop = -1
14331 : * else:
14332 : * stop = shape # <<<<<<<<<<<<<<
14333 : *
14334 : *
14335 : */
14336 : /*else*/ {
14337 : __pyx_v_stop = __pyx_v_shape;
14338 : }
14339 1398 : __pyx_L16:;
14340 : }
14341 1398 : __pyx_L13:;
14342 :
14343 : /* "View.MemoryView":861
14344 : *
14345 : * with cython.cdivision(True):
14346 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
14347 : *
14348 : * if (stop - start) - step * new_shape:
14349 : */
14350 1398 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14351 :
14352 : /* "View.MemoryView":863
14353 : * new_shape = (stop - start) // step
14354 : *
14355 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
14356 : * new_shape += 1
14357 : *
14358 : */
14359 1398 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
14360 1398 : if (__pyx_t_2) {
14361 :
14362 : /* "View.MemoryView":864
14363 : *
14364 : * if (stop - start) - step * new_shape:
14365 : * new_shape += 1 # <<<<<<<<<<<<<<
14366 : *
14367 : * if new_shape < 0:
14368 : */
14369 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
14370 :
14371 : /* "View.MemoryView":863
14372 : * new_shape = (stop - start) // step
14373 : *
14374 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
14375 : * new_shape += 1
14376 : *
14377 : */
14378 : }
14379 :
14380 : /* "View.MemoryView":866
14381 : * new_shape += 1
14382 : *
14383 : * if new_shape < 0: # <<<<<<<<<<<<<<
14384 : * new_shape = 0
14385 : *
14386 : */
14387 1398 : __pyx_t_2 = (__pyx_v_new_shape < 0);
14388 1398 : if (__pyx_t_2) {
14389 :
14390 : /* "View.MemoryView":867
14391 : *
14392 : * if new_shape < 0:
14393 : * new_shape = 0 # <<<<<<<<<<<<<<
14394 : *
14395 : *
14396 : */
14397 : __pyx_v_new_shape = 0;
14398 :
14399 : /* "View.MemoryView":866
14400 : * new_shape += 1
14401 : *
14402 : * if new_shape < 0: # <<<<<<<<<<<<<<
14403 : * new_shape = 0
14404 : *
14405 : */
14406 : }
14407 :
14408 : /* "View.MemoryView":870
14409 : *
14410 : *
14411 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
14412 : * dst.shape[new_ndim] = new_shape
14413 : * dst.suboffsets[new_ndim] = suboffset
14414 : */
14415 1398 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14416 :
14417 : /* "View.MemoryView":871
14418 : *
14419 : * dst.strides[new_ndim] = stride * step
14420 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
14421 : * dst.suboffsets[new_ndim] = suboffset
14422 : *
14423 : */
14424 1398 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14425 :
14426 : /* "View.MemoryView":872
14427 : * dst.strides[new_ndim] = stride * step
14428 : * dst.shape[new_ndim] = new_shape
14429 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
14430 : *
14431 : *
14432 : */
14433 1398 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14434 : }
14435 2796 : __pyx_L3:;
14436 :
14437 : /* "View.MemoryView":875
14438 : *
14439 : *
14440 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
14441 : * dst.data += start * stride
14442 : * else:
14443 : */
14444 2796 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
14445 2796 : if (__pyx_t_2) {
14446 :
14447 : /* "View.MemoryView":876
14448 : *
14449 : * if suboffset_dim[0] < 0:
14450 : * dst.data += start * stride # <<<<<<<<<<<<<<
14451 : * else:
14452 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14453 : */
14454 2796 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14455 :
14456 : /* "View.MemoryView":875
14457 : *
14458 : *
14459 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
14460 : * dst.data += start * stride
14461 : * else:
14462 : */
14463 2796 : goto __pyx_L19;
14464 : }
14465 :
14466 : /* "View.MemoryView":878
14467 : * dst.data += start * stride
14468 : * else:
14469 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
14470 : *
14471 : * if suboffset >= 0:
14472 : */
14473 0 : /*else*/ {
14474 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14475 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14476 : }
14477 2796 : __pyx_L19:;
14478 :
14479 : /* "View.MemoryView":880
14480 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14481 : *
14482 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14483 : * if not is_slice:
14484 : * if new_ndim == 0:
14485 : */
14486 2796 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14487 2796 : if (__pyx_t_2) {
14488 :
14489 : /* "View.MemoryView":881
14490 : *
14491 : * if suboffset >= 0:
14492 : * if not is_slice: # <<<<<<<<<<<<<<
14493 : * if new_ndim == 0:
14494 : * dst.data = (<char **> dst.data)[0] + suboffset
14495 : */
14496 0 : __pyx_t_2 = (!__pyx_v_is_slice);
14497 0 : if (__pyx_t_2) {
14498 :
14499 : /* "View.MemoryView":882
14500 : * if suboffset >= 0:
14501 : * if not is_slice:
14502 : * if new_ndim == 0: # <<<<<<<<<<<<<<
14503 : * dst.data = (<char **> dst.data)[0] + suboffset
14504 : * else:
14505 : */
14506 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
14507 0 : if (__pyx_t_2) {
14508 :
14509 : /* "View.MemoryView":883
14510 : * if not is_slice:
14511 : * if new_ndim == 0:
14512 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
14513 : * else:
14514 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
14515 : */
14516 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14517 :
14518 : /* "View.MemoryView":882
14519 : * if suboffset >= 0:
14520 : * if not is_slice:
14521 : * if new_ndim == 0: # <<<<<<<<<<<<<<
14522 : * dst.data = (<char **> dst.data)[0] + suboffset
14523 : * else:
14524 : */
14525 0 : goto __pyx_L22;
14526 : }
14527 :
14528 : /* "View.MemoryView":885
14529 : * dst.data = (<char **> dst.data)[0] + suboffset
14530 : * else:
14531 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
14532 : * "must be indexed and not sliced", dim)
14533 : * else:
14534 : */
14535 0 : /*else*/ {
14536 :
14537 : /* "View.MemoryView":886
14538 : * else:
14539 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
14540 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
14541 : * else:
14542 : * suboffset_dim[0] = new_ndim
14543 : */
14544 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
14545 : }
14546 0 : __pyx_L22:;
14547 :
14548 : /* "View.MemoryView":881
14549 : *
14550 : * if suboffset >= 0:
14551 : * if not is_slice: # <<<<<<<<<<<<<<
14552 : * if new_ndim == 0:
14553 : * dst.data = (<char **> dst.data)[0] + suboffset
14554 : */
14555 0 : goto __pyx_L21;
14556 : }
14557 :
14558 : /* "View.MemoryView":888
14559 : * "must be indexed and not sliced", dim)
14560 : * else:
14561 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
14562 : *
14563 : * return 0
14564 : */
14565 0 : /*else*/ {
14566 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14567 : }
14568 2796 : __pyx_L21:;
14569 :
14570 : /* "View.MemoryView":880
14571 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14572 : *
14573 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14574 : * if not is_slice:
14575 : * if new_ndim == 0:
14576 : */
14577 : }
14578 :
14579 : /* "View.MemoryView":890
14580 : * suboffset_dim[0] = new_ndim
14581 : *
14582 : * return 0 # <<<<<<<<<<<<<<
14583 : *
14584 : *
14585 : */
14586 2796 : __pyx_r = 0;
14587 2796 : goto __pyx_L0;
14588 :
14589 : /* "View.MemoryView":793
14590 : *
14591 : * @cname('__pyx_memoryview_slice_memviewslice')
14592 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14593 : * __Pyx_memviewslice *dst,
14594 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14595 : */
14596 :
14597 : /* function exit code */
14598 0 : __pyx_L1_error:;
14599 : #ifdef WITH_THREAD
14600 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14601 : #endif
14602 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14603 0 : __pyx_r = -1;
14604 : #ifdef WITH_THREAD
14605 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14606 : #endif
14607 2796 : __pyx_L0:;
14608 2796 : return __pyx_r;
14609 : }
14610 :
14611 : /* "View.MemoryView":896
14612 : *
14613 : * @cname('__pyx_pybuffer_index')
14614 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14615 : * Py_ssize_t dim) except NULL:
14616 : * cdef Py_ssize_t shape, stride, suboffset = -1
14617 : */
14618 :
14619 0 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14620 0 : Py_ssize_t __pyx_v_shape;
14621 0 : Py_ssize_t __pyx_v_stride;
14622 0 : Py_ssize_t __pyx_v_suboffset;
14623 0 : Py_ssize_t __pyx_v_itemsize;
14624 0 : char *__pyx_v_resultp;
14625 0 : char *__pyx_r;
14626 : __Pyx_RefNannyDeclarations
14627 0 : Py_ssize_t __pyx_t_1;
14628 0 : int __pyx_t_2;
14629 0 : PyObject *__pyx_t_3 = NULL;
14630 0 : Py_UCS4 __pyx_t_4;
14631 0 : PyObject *__pyx_t_5 = NULL;
14632 0 : int __pyx_lineno = 0;
14633 0 : const char *__pyx_filename = NULL;
14634 0 : int __pyx_clineno = 0;
14635 0 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
14636 :
14637 : /* "View.MemoryView":898
14638 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14639 : * Py_ssize_t dim) except NULL:
14640 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14641 : * cdef Py_ssize_t itemsize = view.itemsize
14642 : * cdef char *resultp
14643 : */
14644 0 : __pyx_v_suboffset = -1L;
14645 :
14646 : /* "View.MemoryView":899
14647 : * Py_ssize_t dim) except NULL:
14648 : * cdef Py_ssize_t shape, stride, suboffset = -1
14649 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14650 : * cdef char *resultp
14651 : *
14652 : */
14653 0 : __pyx_t_1 = __pyx_v_view->itemsize;
14654 0 : __pyx_v_itemsize = __pyx_t_1;
14655 :
14656 : /* "View.MemoryView":902
14657 : * cdef char *resultp
14658 : *
14659 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14660 : * shape = view.len // itemsize
14661 : * stride = itemsize
14662 : */
14663 0 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
14664 0 : if (__pyx_t_2) {
14665 :
14666 : /* "View.MemoryView":903
14667 : *
14668 : * if view.ndim == 0:
14669 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
14670 : * stride = itemsize
14671 : * else:
14672 : */
14673 0 : if (unlikely(__pyx_v_itemsize == 0)) {
14674 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14675 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14676 : }
14677 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14678 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14679 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14680 : }
14681 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14682 :
14683 : /* "View.MemoryView":904
14684 : * if view.ndim == 0:
14685 : * shape = view.len // itemsize
14686 : * stride = itemsize # <<<<<<<<<<<<<<
14687 : * else:
14688 : * shape = view.shape[dim]
14689 : */
14690 0 : __pyx_v_stride = __pyx_v_itemsize;
14691 :
14692 : /* "View.MemoryView":902
14693 : * cdef char *resultp
14694 : *
14695 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14696 : * shape = view.len // itemsize
14697 : * stride = itemsize
14698 : */
14699 0 : goto __pyx_L3;
14700 : }
14701 :
14702 : /* "View.MemoryView":906
14703 : * stride = itemsize
14704 : * else:
14705 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
14706 : * stride = view.strides[dim]
14707 : * if view.suboffsets != NULL:
14708 : */
14709 0 : /*else*/ {
14710 0 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14711 :
14712 : /* "View.MemoryView":907
14713 : * else:
14714 : * shape = view.shape[dim]
14715 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
14716 : * if view.suboffsets != NULL:
14717 : * suboffset = view.suboffsets[dim]
14718 : */
14719 0 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14720 :
14721 : /* "View.MemoryView":908
14722 : * shape = view.shape[dim]
14723 : * stride = view.strides[dim]
14724 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14725 : * suboffset = view.suboffsets[dim]
14726 : *
14727 : */
14728 0 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14729 0 : if (__pyx_t_2) {
14730 :
14731 : /* "View.MemoryView":909
14732 : * stride = view.strides[dim]
14733 : * if view.suboffsets != NULL:
14734 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14735 : *
14736 : * if index < 0:
14737 : */
14738 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14739 :
14740 : /* "View.MemoryView":908
14741 : * shape = view.shape[dim]
14742 : * stride = view.strides[dim]
14743 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14744 : * suboffset = view.suboffsets[dim]
14745 : *
14746 : */
14747 : }
14748 : }
14749 0 : __pyx_L3:;
14750 :
14751 : /* "View.MemoryView":911
14752 : * suboffset = view.suboffsets[dim]
14753 : *
14754 : * if index < 0: # <<<<<<<<<<<<<<
14755 : * index += view.shape[dim]
14756 : * if index < 0:
14757 : */
14758 0 : __pyx_t_2 = (__pyx_v_index < 0);
14759 0 : if (__pyx_t_2) {
14760 :
14761 : /* "View.MemoryView":912
14762 : *
14763 : * if index < 0:
14764 : * index += view.shape[dim] # <<<<<<<<<<<<<<
14765 : * if index < 0:
14766 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14767 : */
14768 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14769 :
14770 : /* "View.MemoryView":913
14771 : * if index < 0:
14772 : * index += view.shape[dim]
14773 : * if index < 0: # <<<<<<<<<<<<<<
14774 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14775 : *
14776 : */
14777 0 : __pyx_t_2 = (__pyx_v_index < 0);
14778 0 : if (unlikely(__pyx_t_2)) {
14779 :
14780 : /* "View.MemoryView":914
14781 : * index += view.shape[dim]
14782 : * if index < 0:
14783 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14784 : *
14785 : * if index >= shape:
14786 : */
14787 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
14788 0 : __Pyx_GOTREF(__pyx_t_3);
14789 0 : __pyx_t_1 = 0;
14790 0 : __pyx_t_4 = 127;
14791 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14792 0 : __pyx_t_1 += 37;
14793 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14794 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14795 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14796 0 : __Pyx_GOTREF(__pyx_t_5);
14797 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
14798 0 : __Pyx_GIVEREF(__pyx_t_5);
14799 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
14800 0 : __pyx_t_5 = 0;
14801 0 : __Pyx_INCREF(__pyx_kp_u__7);
14802 0 : __pyx_t_1 += 1;
14803 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14804 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
14805 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14806 0 : __Pyx_GOTREF(__pyx_t_5);
14807 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14808 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
14809 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14810 0 : __PYX_ERR(1, 914, __pyx_L1_error)
14811 :
14812 : /* "View.MemoryView":913
14813 : * if index < 0:
14814 : * index += view.shape[dim]
14815 : * if index < 0: # <<<<<<<<<<<<<<
14816 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14817 : *
14818 : */
14819 : }
14820 :
14821 : /* "View.MemoryView":911
14822 : * suboffset = view.suboffsets[dim]
14823 : *
14824 : * if index < 0: # <<<<<<<<<<<<<<
14825 : * index += view.shape[dim]
14826 : * if index < 0:
14827 : */
14828 : }
14829 :
14830 : /* "View.MemoryView":916
14831 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14832 : *
14833 : * if index >= shape: # <<<<<<<<<<<<<<
14834 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14835 : *
14836 : */
14837 0 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14838 0 : if (unlikely(__pyx_t_2)) {
14839 :
14840 : /* "View.MemoryView":917
14841 : *
14842 : * if index >= shape:
14843 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14844 : *
14845 : * resultp = bufp + index * stride
14846 : */
14847 0 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
14848 0 : __Pyx_GOTREF(__pyx_t_5);
14849 0 : __pyx_t_1 = 0;
14850 0 : __pyx_t_4 = 127;
14851 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14852 0 : __pyx_t_1 += 37;
14853 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14854 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14855 0 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14856 0 : __Pyx_GOTREF(__pyx_t_3);
14857 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
14858 0 : __Pyx_GIVEREF(__pyx_t_3);
14859 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
14860 0 : __pyx_t_3 = 0;
14861 0 : __Pyx_INCREF(__pyx_kp_u__7);
14862 0 : __pyx_t_1 += 1;
14863 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14864 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
14865 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14866 0 : __Pyx_GOTREF(__pyx_t_3);
14867 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14868 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
14869 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14870 0 : __PYX_ERR(1, 917, __pyx_L1_error)
14871 :
14872 : /* "View.MemoryView":916
14873 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14874 : *
14875 : * if index >= shape: # <<<<<<<<<<<<<<
14876 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14877 : *
14878 : */
14879 : }
14880 :
14881 : /* "View.MemoryView":919
14882 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14883 : *
14884 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14885 : * if suboffset >= 0:
14886 : * resultp = (<char **> resultp)[0] + suboffset
14887 : */
14888 0 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14889 :
14890 : /* "View.MemoryView":920
14891 : *
14892 : * resultp = bufp + index * stride
14893 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14894 : * resultp = (<char **> resultp)[0] + suboffset
14895 : *
14896 : */
14897 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14898 0 : if (__pyx_t_2) {
14899 :
14900 : /* "View.MemoryView":921
14901 : * resultp = bufp + index * stride
14902 : * if suboffset >= 0:
14903 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14904 : *
14905 : * return resultp
14906 : */
14907 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14908 :
14909 : /* "View.MemoryView":920
14910 : *
14911 : * resultp = bufp + index * stride
14912 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14913 : * resultp = (<char **> resultp)[0] + suboffset
14914 : *
14915 : */
14916 : }
14917 :
14918 : /* "View.MemoryView":923
14919 : * resultp = (<char **> resultp)[0] + suboffset
14920 : *
14921 : * return resultp # <<<<<<<<<<<<<<
14922 : *
14923 : *
14924 : */
14925 0 : __pyx_r = __pyx_v_resultp;
14926 0 : goto __pyx_L0;
14927 :
14928 : /* "View.MemoryView":896
14929 : *
14930 : * @cname('__pyx_pybuffer_index')
14931 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14932 : * Py_ssize_t dim) except NULL:
14933 : * cdef Py_ssize_t shape, stride, suboffset = -1
14934 : */
14935 :
14936 : /* function exit code */
14937 0 : __pyx_L1_error:;
14938 0 : __Pyx_XDECREF(__pyx_t_3);
14939 0 : __Pyx_XDECREF(__pyx_t_5);
14940 0 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14941 0 : __pyx_r = NULL;
14942 0 : __pyx_L0:;
14943 0 : __Pyx_RefNannyFinishContext();
14944 0 : return __pyx_r;
14945 : }
14946 :
14947 : /* "View.MemoryView":929
14948 : *
14949 : * @cname('__pyx_memslice_transpose')
14950 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14951 : * cdef int ndim = memslice.memview.view.ndim
14952 : *
14953 : */
14954 :
14955 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14956 0 : int __pyx_v_ndim;
14957 0 : Py_ssize_t *__pyx_v_shape;
14958 0 : Py_ssize_t *__pyx_v_strides;
14959 0 : int __pyx_v_i;
14960 0 : int __pyx_v_j;
14961 0 : int __pyx_r;
14962 0 : int __pyx_t_1;
14963 0 : Py_ssize_t *__pyx_t_2;
14964 0 : long __pyx_t_3;
14965 0 : long __pyx_t_4;
14966 0 : Py_ssize_t __pyx_t_5;
14967 0 : Py_ssize_t __pyx_t_6;
14968 0 : int __pyx_t_7;
14969 0 : int __pyx_t_8;
14970 0 : int __pyx_t_9;
14971 0 : int __pyx_lineno = 0;
14972 0 : const char *__pyx_filename = NULL;
14973 0 : int __pyx_clineno = 0;
14974 : #ifdef WITH_THREAD
14975 0 : PyGILState_STATE __pyx_gilstate_save;
14976 : #endif
14977 :
14978 : /* "View.MemoryView":930
14979 : * @cname('__pyx_memslice_transpose')
14980 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14981 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14982 : *
14983 : * cdef Py_ssize_t *shape = memslice.shape
14984 : */
14985 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14986 0 : __pyx_v_ndim = __pyx_t_1;
14987 :
14988 : /* "View.MemoryView":932
14989 : * cdef int ndim = memslice.memview.view.ndim
14990 : *
14991 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14992 : * cdef Py_ssize_t *strides = memslice.strides
14993 : *
14994 : */
14995 0 : __pyx_t_2 = __pyx_v_memslice->shape;
14996 0 : __pyx_v_shape = __pyx_t_2;
14997 :
14998 : /* "View.MemoryView":933
14999 : *
15000 : * cdef Py_ssize_t *shape = memslice.shape
15001 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
15002 : *
15003 : *
15004 : */
15005 0 : __pyx_t_2 = __pyx_v_memslice->strides;
15006 0 : __pyx_v_strides = __pyx_t_2;
15007 :
15008 : /* "View.MemoryView":937
15009 : *
15010 : * cdef int i, j
15011 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
15012 : * j = ndim - 1 - i
15013 : * strides[i], strides[j] = strides[j], strides[i]
15014 : */
15015 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
15016 0 : __pyx_t_4 = __pyx_t_3;
15017 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15018 0 : __pyx_v_i = __pyx_t_1;
15019 :
15020 : /* "View.MemoryView":938
15021 : * cdef int i, j
15022 : * for i in range(ndim // 2):
15023 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
15024 : * strides[i], strides[j] = strides[j], strides[i]
15025 : * shape[i], shape[j] = shape[j], shape[i]
15026 : */
15027 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15028 :
15029 : /* "View.MemoryView":939
15030 : * for i in range(ndim // 2):
15031 : * j = ndim - 1 - i
15032 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
15033 : * shape[i], shape[j] = shape[j], shape[i]
15034 : *
15035 : */
15036 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15037 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15038 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15039 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15040 :
15041 : /* "View.MemoryView":940
15042 : * j = ndim - 1 - i
15043 : * strides[i], strides[j] = strides[j], strides[i]
15044 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
15045 : *
15046 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15047 : */
15048 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15049 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15050 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15051 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15052 :
15053 : /* "View.MemoryView":942
15054 : * shape[i], shape[j] = shape[j], shape[i]
15055 : *
15056 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15057 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15058 : *
15059 : */
15060 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
15061 0 : if (!__pyx_t_8) {
15062 : } else {
15063 0 : __pyx_t_7 = __pyx_t_8;
15064 0 : goto __pyx_L6_bool_binop_done;
15065 : }
15066 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
15067 0 : __pyx_t_7 = __pyx_t_8;
15068 0 : __pyx_L6_bool_binop_done:;
15069 0 : if (__pyx_t_7) {
15070 :
15071 : /* "View.MemoryView":943
15072 : *
15073 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15074 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
15075 : *
15076 : * return 0
15077 : */
15078 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
15079 :
15080 : /* "View.MemoryView":942
15081 : * shape[i], shape[j] = shape[j], shape[i]
15082 : *
15083 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15084 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15085 : *
15086 : */
15087 : }
15088 : }
15089 :
15090 : /* "View.MemoryView":945
15091 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15092 : *
15093 : * return 0 # <<<<<<<<<<<<<<
15094 : *
15095 : *
15096 : */
15097 0 : __pyx_r = 0;
15098 0 : goto __pyx_L0;
15099 :
15100 : /* "View.MemoryView":929
15101 : *
15102 : * @cname('__pyx_memslice_transpose')
15103 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
15104 : * cdef int ndim = memslice.memview.view.ndim
15105 : *
15106 : */
15107 :
15108 : /* function exit code */
15109 0 : __pyx_L1_error:;
15110 : #ifdef WITH_THREAD
15111 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15112 : #endif
15113 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15114 0 : __pyx_r = -1;
15115 : #ifdef WITH_THREAD
15116 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
15117 : #endif
15118 0 : __pyx_L0:;
15119 0 : return __pyx_r;
15120 : }
15121 :
15122 : /* "View.MemoryView":963
15123 : * cdef int (*to_dtype_func)(char *, object) except 0
15124 : *
15125 : * def __dealloc__(self): # <<<<<<<<<<<<<<
15126 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15127 : *
15128 : */
15129 :
15130 : /* Python wrapper */
15131 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15132 6345 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15133 6345 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15134 : __Pyx_RefNannyDeclarations
15135 6345 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15136 6345 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
15137 12690 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15138 :
15139 : /* function exit code */
15140 6345 : __Pyx_RefNannyFinishContext();
15141 : }
15142 :
15143 6345 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15144 :
15145 : /* "View.MemoryView":964
15146 : *
15147 : * def __dealloc__(self):
15148 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15149 : *
15150 : * cdef convert_item_to_object(self, char *itemp):
15151 : */
15152 6345 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
15153 :
15154 : /* "View.MemoryView":963
15155 : * cdef int (*to_dtype_func)(char *, object) except 0
15156 : *
15157 : * def __dealloc__(self): # <<<<<<<<<<<<<<
15158 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15159 : *
15160 : */
15161 :
15162 : /* function exit code */
15163 : }
15164 :
15165 : /* "View.MemoryView":966
15166 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15167 : *
15168 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15169 : * if self.to_object_func != NULL:
15170 : * return self.to_object_func(itemp)
15171 : */
15172 :
15173 0 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15174 0 : PyObject *__pyx_r = NULL;
15175 : __Pyx_RefNannyDeclarations
15176 0 : int __pyx_t_1;
15177 0 : PyObject *__pyx_t_2 = NULL;
15178 0 : int __pyx_lineno = 0;
15179 0 : const char *__pyx_filename = NULL;
15180 0 : int __pyx_clineno = 0;
15181 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
15182 :
15183 : /* "View.MemoryView":967
15184 : *
15185 : * cdef convert_item_to_object(self, char *itemp):
15186 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15187 : * return self.to_object_func(itemp)
15188 : * else:
15189 : */
15190 0 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
15191 0 : if (__pyx_t_1) {
15192 :
15193 : /* "View.MemoryView":968
15194 : * cdef convert_item_to_object(self, char *itemp):
15195 : * if self.to_object_func != NULL:
15196 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15197 : * else:
15198 : * return memoryview.convert_item_to_object(self, itemp)
15199 : */
15200 0 : __Pyx_XDECREF(__pyx_r);
15201 0 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
15202 0 : __Pyx_GOTREF(__pyx_t_2);
15203 0 : __pyx_r = __pyx_t_2;
15204 0 : __pyx_t_2 = 0;
15205 0 : goto __pyx_L0;
15206 :
15207 : /* "View.MemoryView":967
15208 : *
15209 : * cdef convert_item_to_object(self, char *itemp):
15210 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15211 : * return self.to_object_func(itemp)
15212 : * else:
15213 : */
15214 : }
15215 :
15216 : /* "View.MemoryView":970
15217 : * return self.to_object_func(itemp)
15218 : * else:
15219 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15220 : *
15221 : * cdef assign_item_from_object(self, char *itemp, object value):
15222 : */
15223 0 : /*else*/ {
15224 0 : __Pyx_XDECREF(__pyx_r);
15225 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
15226 0 : __Pyx_GOTREF(__pyx_t_2);
15227 0 : __pyx_r = __pyx_t_2;
15228 0 : __pyx_t_2 = 0;
15229 0 : goto __pyx_L0;
15230 : }
15231 :
15232 : /* "View.MemoryView":966
15233 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15234 : *
15235 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15236 : * if self.to_object_func != NULL:
15237 : * return self.to_object_func(itemp)
15238 : */
15239 :
15240 : /* function exit code */
15241 0 : __pyx_L1_error:;
15242 0 : __Pyx_XDECREF(__pyx_t_2);
15243 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15244 0 : __pyx_r = 0;
15245 0 : __pyx_L0:;
15246 0 : __Pyx_XGIVEREF(__pyx_r);
15247 0 : __Pyx_RefNannyFinishContext();
15248 0 : return __pyx_r;
15249 : }
15250 :
15251 : /* "View.MemoryView":972
15252 : * return memoryview.convert_item_to_object(self, itemp)
15253 : *
15254 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15255 : * if self.to_dtype_func != NULL:
15256 : * self.to_dtype_func(itemp, value)
15257 : */
15258 :
15259 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15260 0 : PyObject *__pyx_r = NULL;
15261 : __Pyx_RefNannyDeclarations
15262 0 : int __pyx_t_1;
15263 0 : int __pyx_t_2;
15264 0 : PyObject *__pyx_t_3 = NULL;
15265 0 : int __pyx_lineno = 0;
15266 0 : const char *__pyx_filename = NULL;
15267 0 : int __pyx_clineno = 0;
15268 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
15269 :
15270 : /* "View.MemoryView":973
15271 : *
15272 : * cdef assign_item_from_object(self, char *itemp, object value):
15273 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15274 : * self.to_dtype_func(itemp, value)
15275 : * else:
15276 : */
15277 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
15278 0 : if (__pyx_t_1) {
15279 :
15280 : /* "View.MemoryView":974
15281 : * cdef assign_item_from_object(self, char *itemp, object value):
15282 : * if self.to_dtype_func != NULL:
15283 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
15284 : * else:
15285 : * memoryview.assign_item_from_object(self, itemp, value)
15286 : */
15287 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
15288 :
15289 : /* "View.MemoryView":973
15290 : *
15291 : * cdef assign_item_from_object(self, char *itemp, object value):
15292 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15293 : * self.to_dtype_func(itemp, value)
15294 : * else:
15295 : */
15296 0 : goto __pyx_L3;
15297 : }
15298 :
15299 : /* "View.MemoryView":976
15300 : * self.to_dtype_func(itemp, value)
15301 : * else:
15302 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
15303 : *
15304 : * cdef _get_base(self):
15305 : */
15306 0 : /*else*/ {
15307 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
15308 0 : __Pyx_GOTREF(__pyx_t_3);
15309 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15310 : }
15311 0 : __pyx_L3:;
15312 :
15313 : /* "View.MemoryView":972
15314 : * return memoryview.convert_item_to_object(self, itemp)
15315 : *
15316 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15317 : * if self.to_dtype_func != NULL:
15318 : * self.to_dtype_func(itemp, value)
15319 : */
15320 :
15321 : /* function exit code */
15322 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15323 0 : goto __pyx_L0;
15324 0 : __pyx_L1_error:;
15325 0 : __Pyx_XDECREF(__pyx_t_3);
15326 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15327 0 : __pyx_r = 0;
15328 0 : __pyx_L0:;
15329 0 : __Pyx_XGIVEREF(__pyx_r);
15330 0 : __Pyx_RefNannyFinishContext();
15331 0 : return __pyx_r;
15332 : }
15333 :
15334 : /* "View.MemoryView":978
15335 : * memoryview.assign_item_from_object(self, itemp, value)
15336 : *
15337 : * cdef _get_base(self): # <<<<<<<<<<<<<<
15338 : * return self.from_object
15339 : *
15340 : */
15341 :
15342 0 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15343 0 : PyObject *__pyx_r = NULL;
15344 : __Pyx_RefNannyDeclarations
15345 0 : __Pyx_RefNannySetupContext("_get_base", 1);
15346 :
15347 : /* "View.MemoryView":979
15348 : *
15349 : * cdef _get_base(self):
15350 : * return self.from_object # <<<<<<<<<<<<<<
15351 : *
15352 : *
15353 : */
15354 0 : __Pyx_XDECREF(__pyx_r);
15355 0 : __Pyx_INCREF(__pyx_v_self->from_object);
15356 0 : __pyx_r = __pyx_v_self->from_object;
15357 0 : goto __pyx_L0;
15358 :
15359 : /* "View.MemoryView":978
15360 : * memoryview.assign_item_from_object(self, itemp, value)
15361 : *
15362 : * cdef _get_base(self): # <<<<<<<<<<<<<<
15363 : * return self.from_object
15364 : *
15365 : */
15366 :
15367 : /* function exit code */
15368 0 : __pyx_L0:;
15369 0 : __Pyx_XGIVEREF(__pyx_r);
15370 0 : __Pyx_RefNannyFinishContext();
15371 0 : return __pyx_r;
15372 : }
15373 :
15374 : /* "(tree fragment)":1
15375 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15376 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15377 : * def __setstate_cython__(self, __pyx_state):
15378 : */
15379 :
15380 : /* Python wrapper */
15381 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
15382 : #if CYTHON_METH_FASTCALL
15383 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15384 : #else
15385 : PyObject *__pyx_args, PyObject *__pyx_kwds
15386 : #endif
15387 : ); /*proto*/
15388 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
15389 : #if CYTHON_METH_FASTCALL
15390 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15391 : #else
15392 : PyObject *__pyx_args, PyObject *__pyx_kwds
15393 : #endif
15394 : ) {
15395 : #if !CYTHON_METH_FASTCALL
15396 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15397 : #endif
15398 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15399 0 : PyObject *__pyx_r = 0;
15400 : __Pyx_RefNannyDeclarations
15401 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15402 : #if !CYTHON_METH_FASTCALL
15403 : #if CYTHON_ASSUME_SAFE_MACROS
15404 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15405 : #else
15406 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15407 : #endif
15408 : #endif
15409 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15410 0 : if (unlikely(__pyx_nargs > 0)) {
15411 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
15412 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
15413 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15414 :
15415 : /* function exit code */
15416 0 : __Pyx_RefNannyFinishContext();
15417 0 : return __pyx_r;
15418 : }
15419 :
15420 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15421 0 : PyObject *__pyx_r = NULL;
15422 : __Pyx_RefNannyDeclarations
15423 0 : int __pyx_lineno = 0;
15424 0 : const char *__pyx_filename = NULL;
15425 0 : int __pyx_clineno = 0;
15426 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
15427 :
15428 : /* "(tree fragment)":2
15429 : * def __reduce_cython__(self):
15430 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15431 : * def __setstate_cython__(self, __pyx_state):
15432 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15433 : */
15434 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
15435 0 : __PYX_ERR(1, 2, __pyx_L1_error)
15436 :
15437 : /* "(tree fragment)":1
15438 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15439 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15440 : * def __setstate_cython__(self, __pyx_state):
15441 : */
15442 :
15443 : /* function exit code */
15444 0 : __pyx_L1_error:;
15445 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15446 0 : __pyx_r = NULL;
15447 0 : __Pyx_XGIVEREF(__pyx_r);
15448 0 : __Pyx_RefNannyFinishContext();
15449 0 : return __pyx_r;
15450 : }
15451 :
15452 : /* "(tree fragment)":3
15453 : * def __reduce_cython__(self):
15454 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15455 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15456 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15457 : */
15458 :
15459 : /* Python wrapper */
15460 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15461 : #if CYTHON_METH_FASTCALL
15462 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15463 : #else
15464 : PyObject *__pyx_args, PyObject *__pyx_kwds
15465 : #endif
15466 : ); /*proto*/
15467 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15468 : #if CYTHON_METH_FASTCALL
15469 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15470 : #else
15471 : PyObject *__pyx_args, PyObject *__pyx_kwds
15472 : #endif
15473 : ) {
15474 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15475 : #if !CYTHON_METH_FASTCALL
15476 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15477 : #endif
15478 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15479 0 : PyObject* values[1] = {0};
15480 0 : int __pyx_lineno = 0;
15481 0 : const char *__pyx_filename = NULL;
15482 0 : int __pyx_clineno = 0;
15483 0 : PyObject *__pyx_r = 0;
15484 : __Pyx_RefNannyDeclarations
15485 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15486 : #if !CYTHON_METH_FASTCALL
15487 : #if CYTHON_ASSUME_SAFE_MACROS
15488 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15489 : #else
15490 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15491 : #endif
15492 : #endif
15493 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15494 0 : {
15495 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
15496 0 : if (__pyx_kwds) {
15497 0 : Py_ssize_t kw_args;
15498 0 : switch (__pyx_nargs) {
15499 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
15500 0 : CYTHON_FALLTHROUGH;
15501 0 : case 0: break;
15502 0 : default: goto __pyx_L5_argtuple_error;
15503 : }
15504 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
15505 0 : switch (__pyx_nargs) {
15506 0 : case 0:
15507 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
15508 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
15509 0 : kw_args--;
15510 : }
15511 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
15512 0 : else goto __pyx_L5_argtuple_error;
15513 : }
15514 0 : if (unlikely(kw_args > 0)) {
15515 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
15516 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15517 : }
15518 0 : } else if (unlikely(__pyx_nargs != 1)) {
15519 0 : goto __pyx_L5_argtuple_error;
15520 : } else {
15521 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
15522 : }
15523 0 : __pyx_v___pyx_state = values[0];
15524 : }
15525 0 : goto __pyx_L6_skip;
15526 0 : __pyx_L5_argtuple_error:;
15527 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15528 0 : __pyx_L6_skip:;
15529 0 : goto __pyx_L4_argument_unpacking_done;
15530 0 : __pyx_L3_error:;
15531 0 : {
15532 0 : Py_ssize_t __pyx_temp;
15533 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15534 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
15535 : }
15536 : }
15537 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15538 : __Pyx_RefNannyFinishContext();
15539 : return NULL;
15540 0 : __pyx_L4_argument_unpacking_done:;
15541 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15542 :
15543 : /* function exit code */
15544 : {
15545 : Py_ssize_t __pyx_temp;
15546 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15547 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
15548 : }
15549 : }
15550 : __Pyx_RefNannyFinishContext();
15551 : return __pyx_r;
15552 : }
15553 :
15554 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15555 0 : PyObject *__pyx_r = NULL;
15556 : __Pyx_RefNannyDeclarations
15557 0 : int __pyx_lineno = 0;
15558 0 : const char *__pyx_filename = NULL;
15559 0 : int __pyx_clineno = 0;
15560 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
15561 :
15562 : /* "(tree fragment)":4
15563 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15564 : * def __setstate_cython__(self, __pyx_state):
15565 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15566 : */
15567 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
15568 0 : __PYX_ERR(1, 4, __pyx_L1_error)
15569 :
15570 : /* "(tree fragment)":3
15571 : * def __reduce_cython__(self):
15572 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15573 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15574 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15575 : */
15576 :
15577 : /* function exit code */
15578 0 : __pyx_L1_error:;
15579 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15580 0 : __pyx_r = NULL;
15581 0 : __Pyx_XGIVEREF(__pyx_r);
15582 0 : __Pyx_RefNannyFinishContext();
15583 0 : return __pyx_r;
15584 : }
15585 :
15586 : /* "View.MemoryView":999
15587 : *
15588 : * @cname('__pyx_memoryview_fromslice')
15589 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15590 : * int ndim,
15591 : * object (*to_object_func)(char *),
15592 : */
15593 :
15594 6345 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
15595 6345 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15596 6345 : Py_ssize_t __pyx_v_suboffset;
15597 6345 : PyObject *__pyx_v_length = NULL;
15598 6345 : PyObject *__pyx_r = NULL;
15599 : __Pyx_RefNannyDeclarations
15600 6345 : int __pyx_t_1;
15601 6345 : PyObject *__pyx_t_2 = NULL;
15602 6345 : PyObject *__pyx_t_3 = NULL;
15603 6345 : __Pyx_TypeInfo *__pyx_t_4;
15604 6345 : Py_buffer __pyx_t_5;
15605 6345 : Py_ssize_t *__pyx_t_6;
15606 6345 : Py_ssize_t *__pyx_t_7;
15607 6345 : Py_ssize_t *__pyx_t_8;
15608 6345 : Py_ssize_t __pyx_t_9;
15609 6345 : int __pyx_lineno = 0;
15610 6345 : const char *__pyx_filename = NULL;
15611 6345 : int __pyx_clineno = 0;
15612 6345 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
15613 :
15614 : /* "View.MemoryView":1007
15615 : * cdef _memoryviewslice result
15616 : *
15617 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15618 : * return None
15619 : *
15620 : */
15621 6345 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15622 6345 : if (__pyx_t_1) {
15623 :
15624 : /* "View.MemoryView":1008
15625 : *
15626 : * if <PyObject *> memviewslice.memview == Py_None:
15627 : * return None # <<<<<<<<<<<<<<
15628 : *
15629 : *
15630 : */
15631 0 : __Pyx_XDECREF(__pyx_r);
15632 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15633 0 : goto __pyx_L0;
15634 :
15635 : /* "View.MemoryView":1007
15636 : * cdef _memoryviewslice result
15637 : *
15638 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15639 : * return None
15640 : *
15641 : */
15642 : }
15643 :
15644 : /* "View.MemoryView":1013
15645 : *
15646 : *
15647 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15648 : *
15649 : * result.from_slice = memviewslice
15650 : */
15651 6345 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15652 6345 : __Pyx_GOTREF(__pyx_t_2);
15653 6345 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
15654 6345 : __Pyx_GOTREF(__pyx_t_3);
15655 6345 : __Pyx_INCREF(Py_None);
15656 6345 : __Pyx_GIVEREF(Py_None);
15657 6345 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
15658 6345 : __Pyx_INCREF(__pyx_int_0);
15659 6345 : __Pyx_GIVEREF(__pyx_int_0);
15660 6345 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
15661 6345 : __Pyx_GIVEREF(__pyx_t_2);
15662 6345 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
15663 6345 : __pyx_t_2 = 0;
15664 6345 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15665 6345 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
15666 6345 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15667 6345 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15668 6345 : __pyx_t_2 = 0;
15669 :
15670 : /* "View.MemoryView":1015
15671 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15672 : *
15673 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15674 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15675 : *
15676 : */
15677 6345 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
15678 :
15679 : /* "View.MemoryView":1016
15680 : *
15681 : * result.from_slice = memviewslice
15682 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15683 : *
15684 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15685 : */
15686 6345 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15687 :
15688 : /* "View.MemoryView":1018
15689 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15690 : *
15691 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15692 : * result.typeinfo = memviewslice.memview.typeinfo
15693 : *
15694 : */
15695 6345 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
15696 6345 : __Pyx_GOTREF(__pyx_t_2);
15697 6345 : __Pyx_GIVEREF(__pyx_t_2);
15698 6345 : __Pyx_GOTREF(__pyx_v_result->from_object);
15699 6345 : __Pyx_DECREF(__pyx_v_result->from_object);
15700 6345 : __pyx_v_result->from_object = __pyx_t_2;
15701 6345 : __pyx_t_2 = 0;
15702 :
15703 : /* "View.MemoryView":1019
15704 : *
15705 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15706 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15707 : *
15708 : * result.view = memviewslice.memview.view
15709 : */
15710 6345 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15711 6345 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15712 :
15713 : /* "View.MemoryView":1021
15714 : * result.typeinfo = memviewslice.memview.typeinfo
15715 : *
15716 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15717 : * result.view.buf = <void *> memviewslice.data
15718 : * result.view.ndim = ndim
15719 : */
15720 6345 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15721 6345 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
15722 :
15723 : /* "View.MemoryView":1022
15724 : *
15725 : * result.view = memviewslice.memview.view
15726 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15727 : * result.view.ndim = ndim
15728 : * (<__pyx_buffer *> &result.view).obj = Py_None
15729 : */
15730 6345 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15731 :
15732 : /* "View.MemoryView":1023
15733 : * result.view = memviewslice.memview.view
15734 : * result.view.buf = <void *> memviewslice.data
15735 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
15736 : * (<__pyx_buffer *> &result.view).obj = Py_None
15737 : * Py_INCREF(Py_None)
15738 : */
15739 6345 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15740 :
15741 : /* "View.MemoryView":1024
15742 : * result.view.buf = <void *> memviewslice.data
15743 : * result.view.ndim = ndim
15744 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15745 : * Py_INCREF(Py_None)
15746 : *
15747 : */
15748 6345 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15749 :
15750 : /* "View.MemoryView":1025
15751 : * result.view.ndim = ndim
15752 : * (<__pyx_buffer *> &result.view).obj = Py_None
15753 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15754 : *
15755 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15756 : */
15757 6345 : Py_INCREF(Py_None);
15758 :
15759 : /* "View.MemoryView":1027
15760 : * Py_INCREF(Py_None)
15761 : *
15762 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15763 : * result.flags = PyBUF_RECORDS
15764 : * else:
15765 : */
15766 6345 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15767 6345 : if (__pyx_t_1) {
15768 :
15769 : /* "View.MemoryView":1028
15770 : *
15771 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15772 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15773 : * else:
15774 : * result.flags = PyBUF_RECORDS_RO
15775 : */
15776 6345 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15777 :
15778 : /* "View.MemoryView":1027
15779 : * Py_INCREF(Py_None)
15780 : *
15781 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15782 : * result.flags = PyBUF_RECORDS
15783 : * else:
15784 : */
15785 6345 : goto __pyx_L4;
15786 : }
15787 :
15788 : /* "View.MemoryView":1030
15789 : * result.flags = PyBUF_RECORDS
15790 : * else:
15791 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15792 : *
15793 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15794 : */
15795 0 : /*else*/ {
15796 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15797 : }
15798 6345 : __pyx_L4:;
15799 :
15800 : /* "View.MemoryView":1032
15801 : * result.flags = PyBUF_RECORDS_RO
15802 : *
15803 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15804 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15805 : *
15806 : */
15807 6345 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15808 :
15809 : /* "View.MemoryView":1033
15810 : *
15811 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15812 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15813 : *
15814 : *
15815 : */
15816 6345 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15817 :
15818 : /* "View.MemoryView":1036
15819 : *
15820 : *
15821 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15822 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15823 : * if suboffset >= 0:
15824 : */
15825 6345 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15826 :
15827 : /* "View.MemoryView":1037
15828 : *
15829 : * result.view.suboffsets = NULL
15830 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15831 : * if suboffset >= 0:
15832 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15833 : */
15834 6345 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15835 13633 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15836 7288 : __pyx_t_6 = __pyx_t_8;
15837 7288 : __pyx_v_suboffset = (__pyx_t_6[0]);
15838 :
15839 : /* "View.MemoryView":1038
15840 : * result.view.suboffsets = NULL
15841 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15842 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15843 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15844 : * break
15845 : */
15846 7288 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
15847 7288 : if (__pyx_t_1) {
15848 :
15849 : /* "View.MemoryView":1039
15850 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15851 : * if suboffset >= 0:
15852 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15853 : * break
15854 : *
15855 : */
15856 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15857 :
15858 : /* "View.MemoryView":1040
15859 : * if suboffset >= 0:
15860 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15861 : * break # <<<<<<<<<<<<<<
15862 : *
15863 : * result.view.len = result.view.itemsize
15864 : */
15865 0 : goto __pyx_L6_break;
15866 :
15867 : /* "View.MemoryView":1038
15868 : * result.view.suboffsets = NULL
15869 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15870 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15871 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15872 : * break
15873 : */
15874 : }
15875 : }
15876 6345 : __pyx_L6_break:;
15877 :
15878 : /* "View.MemoryView":1042
15879 : * break
15880 : *
15881 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15882 : * for length in result.view.shape[:ndim]:
15883 : * result.view.len *= length
15884 : */
15885 6345 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15886 6345 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15887 :
15888 : /* "View.MemoryView":1043
15889 : *
15890 : * result.view.len = result.view.itemsize
15891 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15892 : * result.view.len *= length
15893 : *
15894 : */
15895 6345 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15896 13633 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15897 7288 : __pyx_t_6 = __pyx_t_8;
15898 7288 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
15899 7288 : __Pyx_GOTREF(__pyx_t_2);
15900 7288 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15901 7288 : __pyx_t_2 = 0;
15902 :
15903 : /* "View.MemoryView":1044
15904 : * result.view.len = result.view.itemsize
15905 : * for length in result.view.shape[:ndim]:
15906 : * result.view.len *= length # <<<<<<<<<<<<<<
15907 : *
15908 : * result.to_object_func = to_object_func
15909 : */
15910 7288 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
15911 7288 : __Pyx_GOTREF(__pyx_t_2);
15912 7288 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
15913 7288 : __Pyx_GOTREF(__pyx_t_3);
15914 7288 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15915 7288 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
15916 7288 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15917 7288 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15918 : }
15919 :
15920 : /* "View.MemoryView":1046
15921 : * result.view.len *= length
15922 : *
15923 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15924 : * result.to_dtype_func = to_dtype_func
15925 : *
15926 : */
15927 6345 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15928 :
15929 : /* "View.MemoryView":1047
15930 : *
15931 : * result.to_object_func = to_object_func
15932 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15933 : *
15934 : * return result
15935 : */
15936 6345 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15937 :
15938 : /* "View.MemoryView":1049
15939 : * result.to_dtype_func = to_dtype_func
15940 : *
15941 : * return result # <<<<<<<<<<<<<<
15942 : *
15943 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15944 : */
15945 6345 : __Pyx_XDECREF(__pyx_r);
15946 6345 : __Pyx_INCREF((PyObject *)__pyx_v_result);
15947 6345 : __pyx_r = ((PyObject *)__pyx_v_result);
15948 6345 : goto __pyx_L0;
15949 :
15950 : /* "View.MemoryView":999
15951 : *
15952 : * @cname('__pyx_memoryview_fromslice')
15953 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15954 : * int ndim,
15955 : * object (*to_object_func)(char *),
15956 : */
15957 :
15958 : /* function exit code */
15959 0 : __pyx_L1_error:;
15960 0 : __Pyx_XDECREF(__pyx_t_2);
15961 0 : __Pyx_XDECREF(__pyx_t_3);
15962 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15963 : __pyx_r = 0;
15964 6345 : __pyx_L0:;
15965 6345 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
15966 6345 : __Pyx_XDECREF(__pyx_v_length);
15967 6345 : __Pyx_XGIVEREF(__pyx_r);
15968 6345 : __Pyx_RefNannyFinishContext();
15969 6345 : return __pyx_r;
15970 : }
15971 :
15972 : /* "View.MemoryView":1052
15973 : *
15974 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15975 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15976 : * __Pyx_memviewslice *mslice) except NULL:
15977 : * cdef _memoryviewslice obj
15978 : */
15979 :
15980 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15981 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15982 0 : __Pyx_memviewslice *__pyx_r;
15983 : __Pyx_RefNannyDeclarations
15984 0 : int __pyx_t_1;
15985 0 : PyObject *__pyx_t_2 = NULL;
15986 0 : int __pyx_lineno = 0;
15987 0 : const char *__pyx_filename = NULL;
15988 0 : int __pyx_clineno = 0;
15989 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
15990 :
15991 : /* "View.MemoryView":1055
15992 : * __Pyx_memviewslice *mslice) except NULL:
15993 : * cdef _memoryviewslice obj
15994 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15995 : * obj = memview
15996 : * return &obj.from_slice
15997 : */
15998 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15999 0 : if (__pyx_t_1) {
16000 :
16001 : /* "View.MemoryView":1056
16002 : * cdef _memoryviewslice obj
16003 : * if isinstance(memview, _memoryviewslice):
16004 : * obj = memview # <<<<<<<<<<<<<<
16005 : * return &obj.from_slice
16006 : * else:
16007 : */
16008 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
16009 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
16010 0 : __Pyx_INCREF(__pyx_t_2);
16011 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16012 0 : __pyx_t_2 = 0;
16013 :
16014 : /* "View.MemoryView":1057
16015 : * if isinstance(memview, _memoryviewslice):
16016 : * obj = memview
16017 : * return &obj.from_slice # <<<<<<<<<<<<<<
16018 : * else:
16019 : * slice_copy(memview, mslice)
16020 : */
16021 0 : __pyx_r = (&__pyx_v_obj->from_slice);
16022 0 : goto __pyx_L0;
16023 :
16024 : /* "View.MemoryView":1055
16025 : * __Pyx_memviewslice *mslice) except NULL:
16026 : * cdef _memoryviewslice obj
16027 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16028 : * obj = memview
16029 : * return &obj.from_slice
16030 : */
16031 : }
16032 :
16033 : /* "View.MemoryView":1059
16034 : * return &obj.from_slice
16035 : * else:
16036 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
16037 : * return mslice
16038 : *
16039 : */
16040 0 : /*else*/ {
16041 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16042 :
16043 : /* "View.MemoryView":1060
16044 : * else:
16045 : * slice_copy(memview, mslice)
16046 : * return mslice # <<<<<<<<<<<<<<
16047 : *
16048 : * @cname('__pyx_memoryview_slice_copy')
16049 : */
16050 0 : __pyx_r = __pyx_v_mslice;
16051 0 : goto __pyx_L0;
16052 : }
16053 :
16054 : /* "View.MemoryView":1052
16055 : *
16056 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16057 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16058 : * __Pyx_memviewslice *mslice) except NULL:
16059 : * cdef _memoryviewslice obj
16060 : */
16061 :
16062 : /* function exit code */
16063 0 : __pyx_L1_error:;
16064 0 : __Pyx_XDECREF(__pyx_t_2);
16065 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16066 0 : __pyx_r = NULL;
16067 0 : __pyx_L0:;
16068 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16069 0 : __Pyx_RefNannyFinishContext();
16070 0 : return __pyx_r;
16071 : }
16072 :
16073 : /* "View.MemoryView":1063
16074 : *
16075 : * @cname('__pyx_memoryview_slice_copy')
16076 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
16077 : * cdef int dim
16078 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16079 : */
16080 :
16081 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16082 0 : int __pyx_v_dim;
16083 0 : Py_ssize_t *__pyx_v_shape;
16084 0 : Py_ssize_t *__pyx_v_strides;
16085 0 : Py_ssize_t *__pyx_v_suboffsets;
16086 0 : Py_ssize_t *__pyx_t_1;
16087 0 : int __pyx_t_2;
16088 0 : int __pyx_t_3;
16089 0 : int __pyx_t_4;
16090 0 : Py_ssize_t __pyx_t_5;
16091 0 : int __pyx_t_6;
16092 :
16093 : /* "View.MemoryView":1067
16094 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16095 : *
16096 : * shape = memview.view.shape # <<<<<<<<<<<<<<
16097 : * strides = memview.view.strides
16098 : * suboffsets = memview.view.suboffsets
16099 : */
16100 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
16101 0 : __pyx_v_shape = __pyx_t_1;
16102 :
16103 : /* "View.MemoryView":1068
16104 : *
16105 : * shape = memview.view.shape
16106 : * strides = memview.view.strides # <<<<<<<<<<<<<<
16107 : * suboffsets = memview.view.suboffsets
16108 : *
16109 : */
16110 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
16111 0 : __pyx_v_strides = __pyx_t_1;
16112 :
16113 : /* "View.MemoryView":1069
16114 : * shape = memview.view.shape
16115 : * strides = memview.view.strides
16116 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16117 : *
16118 : * dst.memview = <__pyx_memoryview *> memview
16119 : */
16120 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16121 0 : __pyx_v_suboffsets = __pyx_t_1;
16122 :
16123 : /* "View.MemoryView":1071
16124 : * suboffsets = memview.view.suboffsets
16125 : *
16126 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16127 : * dst.data = <char *> memview.view.buf
16128 : *
16129 : */
16130 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16131 :
16132 : /* "View.MemoryView":1072
16133 : *
16134 : * dst.memview = <__pyx_memoryview *> memview
16135 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16136 : *
16137 : * for dim in range(memview.view.ndim):
16138 : */
16139 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16140 :
16141 : /* "View.MemoryView":1074
16142 : * dst.data = <char *> memview.view.buf
16143 : *
16144 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16145 : * dst.shape[dim] = shape[dim]
16146 : * dst.strides[dim] = strides[dim]
16147 : */
16148 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
16149 0 : __pyx_t_3 = __pyx_t_2;
16150 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16151 0 : __pyx_v_dim = __pyx_t_4;
16152 :
16153 : /* "View.MemoryView":1075
16154 : *
16155 : * for dim in range(memview.view.ndim):
16156 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16157 : * dst.strides[dim] = strides[dim]
16158 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16159 : */
16160 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16161 :
16162 : /* "View.MemoryView":1076
16163 : * for dim in range(memview.view.ndim):
16164 : * dst.shape[dim] = shape[dim]
16165 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16166 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16167 : *
16168 : */
16169 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16170 :
16171 : /* "View.MemoryView":1077
16172 : * dst.shape[dim] = shape[dim]
16173 : * dst.strides[dim] = strides[dim]
16174 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16175 : *
16176 : * @cname('__pyx_memoryview_copy_object')
16177 : */
16178 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
16179 0 : if (__pyx_t_6) {
16180 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16181 : } else {
16182 : __pyx_t_5 = -1L;
16183 : }
16184 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16185 : }
16186 :
16187 : /* "View.MemoryView":1063
16188 : *
16189 : * @cname('__pyx_memoryview_slice_copy')
16190 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
16191 : * cdef int dim
16192 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16193 : */
16194 :
16195 : /* function exit code */
16196 0 : }
16197 :
16198 : /* "View.MemoryView":1080
16199 : *
16200 : * @cname('__pyx_memoryview_copy_object')
16201 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16202 : * "Create a new memoryview object"
16203 : * cdef __Pyx_memviewslice memviewslice
16204 : */
16205 :
16206 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16207 0 : __Pyx_memviewslice __pyx_v_memviewslice;
16208 0 : PyObject *__pyx_r = NULL;
16209 : __Pyx_RefNannyDeclarations
16210 0 : PyObject *__pyx_t_1 = NULL;
16211 0 : int __pyx_lineno = 0;
16212 0 : const char *__pyx_filename = NULL;
16213 0 : int __pyx_clineno = 0;
16214 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
16215 :
16216 : /* "View.MemoryView":1083
16217 : * "Create a new memoryview object"
16218 : * cdef __Pyx_memviewslice memviewslice
16219 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16220 : * return memoryview_copy_from_slice(memview, &memviewslice)
16221 : *
16222 : */
16223 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16224 :
16225 : /* "View.MemoryView":1084
16226 : * cdef __Pyx_memviewslice memviewslice
16227 : * slice_copy(memview, &memviewslice)
16228 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16229 : *
16230 : * @cname('__pyx_memoryview_copy_object_from_slice')
16231 : */
16232 0 : __Pyx_XDECREF(__pyx_r);
16233 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
16234 0 : __Pyx_GOTREF(__pyx_t_1);
16235 0 : __pyx_r = __pyx_t_1;
16236 0 : __pyx_t_1 = 0;
16237 0 : goto __pyx_L0;
16238 :
16239 : /* "View.MemoryView":1080
16240 : *
16241 : * @cname('__pyx_memoryview_copy_object')
16242 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16243 : * "Create a new memoryview object"
16244 : * cdef __Pyx_memviewslice memviewslice
16245 : */
16246 :
16247 : /* function exit code */
16248 0 : __pyx_L1_error:;
16249 0 : __Pyx_XDECREF(__pyx_t_1);
16250 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16251 : __pyx_r = 0;
16252 0 : __pyx_L0:;
16253 0 : __Pyx_XGIVEREF(__pyx_r);
16254 0 : __Pyx_RefNannyFinishContext();
16255 0 : return __pyx_r;
16256 : }
16257 :
16258 : /* "View.MemoryView":1087
16259 : *
16260 : * @cname('__pyx_memoryview_copy_object_from_slice')
16261 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16262 : * """
16263 : * Create a new memoryview object from a given memoryview object and slice.
16264 : */
16265 :
16266 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16267 0 : PyObject *(*__pyx_v_to_object_func)(char *);
16268 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
16269 0 : PyObject *__pyx_r = NULL;
16270 : __Pyx_RefNannyDeclarations
16271 0 : int __pyx_t_1;
16272 0 : PyObject *(*__pyx_t_2)(char *);
16273 0 : int (*__pyx_t_3)(char *, PyObject *);
16274 0 : PyObject *__pyx_t_4 = NULL;
16275 0 : int __pyx_lineno = 0;
16276 0 : const char *__pyx_filename = NULL;
16277 0 : int __pyx_clineno = 0;
16278 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
16279 :
16280 : /* "View.MemoryView":1094
16281 : * cdef int (*to_dtype_func)(char *, object) except 0
16282 : *
16283 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16284 : * to_object_func = (<_memoryviewslice> memview).to_object_func
16285 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16286 : */
16287 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16288 0 : if (__pyx_t_1) {
16289 :
16290 : /* "View.MemoryView":1095
16291 : *
16292 : * if isinstance(memview, _memoryviewslice):
16293 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
16294 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16295 : * else:
16296 : */
16297 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16298 0 : __pyx_v_to_object_func = __pyx_t_2;
16299 :
16300 : /* "View.MemoryView":1096
16301 : * if isinstance(memview, _memoryviewslice):
16302 : * to_object_func = (<_memoryviewslice> memview).to_object_func
16303 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
16304 : * else:
16305 : * to_object_func = NULL
16306 : */
16307 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16308 0 : __pyx_v_to_dtype_func = __pyx_t_3;
16309 :
16310 : /* "View.MemoryView":1094
16311 : * cdef int (*to_dtype_func)(char *, object) except 0
16312 : *
16313 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16314 : * to_object_func = (<_memoryviewslice> memview).to_object_func
16315 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16316 : */
16317 0 : goto __pyx_L3;
16318 : }
16319 :
16320 : /* "View.MemoryView":1098
16321 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16322 : * else:
16323 : * to_object_func = NULL # <<<<<<<<<<<<<<
16324 : * to_dtype_func = NULL
16325 : *
16326 : */
16327 : /*else*/ {
16328 : __pyx_v_to_object_func = NULL;
16329 :
16330 : /* "View.MemoryView":1099
16331 : * else:
16332 : * to_object_func = NULL
16333 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
16334 : *
16335 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16336 : */
16337 : __pyx_v_to_dtype_func = NULL;
16338 : }
16339 0 : __pyx_L3:;
16340 :
16341 : /* "View.MemoryView":1101
16342 : * to_dtype_func = NULL
16343 : *
16344 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
16345 : * to_object_func, to_dtype_func,
16346 : * memview.dtype_is_object)
16347 : */
16348 0 : __Pyx_XDECREF(__pyx_r);
16349 :
16350 : /* "View.MemoryView":1103
16351 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16352 : * to_object_func, to_dtype_func,
16353 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
16354 : *
16355 : *
16356 : */
16357 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
16358 0 : __Pyx_GOTREF(__pyx_t_4);
16359 0 : __pyx_r = __pyx_t_4;
16360 0 : __pyx_t_4 = 0;
16361 0 : goto __pyx_L0;
16362 :
16363 : /* "View.MemoryView":1087
16364 : *
16365 : * @cname('__pyx_memoryview_copy_object_from_slice')
16366 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16367 : * """
16368 : * Create a new memoryview object from a given memoryview object and slice.
16369 : */
16370 :
16371 : /* function exit code */
16372 0 : __pyx_L1_error:;
16373 0 : __Pyx_XDECREF(__pyx_t_4);
16374 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16375 0 : __pyx_r = 0;
16376 0 : __pyx_L0:;
16377 0 : __Pyx_XGIVEREF(__pyx_r);
16378 0 : __Pyx_RefNannyFinishContext();
16379 0 : return __pyx_r;
16380 : }
16381 :
16382 : /* "View.MemoryView":1109
16383 : *
16384 : *
16385 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16386 : * return -arg if arg < 0 else arg
16387 : *
16388 : */
16389 :
16390 0 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16391 0 : Py_ssize_t __pyx_r;
16392 0 : Py_ssize_t __pyx_t_1;
16393 0 : int __pyx_t_2;
16394 :
16395 : /* "View.MemoryView":1110
16396 : *
16397 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
16398 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
16399 : *
16400 : * @cname('__pyx_get_best_slice_order')
16401 : */
16402 0 : __pyx_t_2 = (__pyx_v_arg < 0);
16403 0 : if (__pyx_t_2) {
16404 : __pyx_t_1 = (-__pyx_v_arg);
16405 : } else {
16406 : __pyx_t_1 = __pyx_v_arg;
16407 : }
16408 0 : __pyx_r = __pyx_t_1;
16409 0 : goto __pyx_L0;
16410 :
16411 : /* "View.MemoryView":1109
16412 : *
16413 : *
16414 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16415 : * return -arg if arg < 0 else arg
16416 : *
16417 : */
16418 :
16419 : /* function exit code */
16420 0 : __pyx_L0:;
16421 0 : return __pyx_r;
16422 : }
16423 :
16424 : /* "View.MemoryView":1113
16425 : *
16426 : * @cname('__pyx_get_best_slice_order')
16427 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16428 : * """
16429 : * Figure out the best memory access order for a given slice.
16430 : */
16431 :
16432 0 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16433 0 : int __pyx_v_i;
16434 0 : Py_ssize_t __pyx_v_c_stride;
16435 0 : Py_ssize_t __pyx_v_f_stride;
16436 0 : char __pyx_r;
16437 0 : int __pyx_t_1;
16438 0 : int __pyx_t_2;
16439 0 : int __pyx_t_3;
16440 0 : int __pyx_t_4;
16441 :
16442 : /* "View.MemoryView":1118
16443 : * """
16444 : * cdef int i
16445 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
16446 : * cdef Py_ssize_t f_stride = 0
16447 : *
16448 : */
16449 0 : __pyx_v_c_stride = 0;
16450 :
16451 : /* "View.MemoryView":1119
16452 : * cdef int i
16453 : * cdef Py_ssize_t c_stride = 0
16454 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
16455 : *
16456 : * for i in range(ndim - 1, -1, -1):
16457 : */
16458 0 : __pyx_v_f_stride = 0;
16459 :
16460 : /* "View.MemoryView":1121
16461 : * cdef Py_ssize_t f_stride = 0
16462 : *
16463 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16464 : * if mslice.shape[i] > 1:
16465 : * c_stride = mslice.strides[i]
16466 : */
16467 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16468 0 : __pyx_v_i = __pyx_t_1;
16469 :
16470 : /* "View.MemoryView":1122
16471 : *
16472 : * for i in range(ndim - 1, -1, -1):
16473 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16474 : * c_stride = mslice.strides[i]
16475 : * break
16476 : */
16477 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16478 0 : if (__pyx_t_2) {
16479 :
16480 : /* "View.MemoryView":1123
16481 : * for i in range(ndim - 1, -1, -1):
16482 : * if mslice.shape[i] > 1:
16483 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16484 : * break
16485 : *
16486 : */
16487 0 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16488 :
16489 : /* "View.MemoryView":1124
16490 : * if mslice.shape[i] > 1:
16491 : * c_stride = mslice.strides[i]
16492 : * break # <<<<<<<<<<<<<<
16493 : *
16494 : * for i in range(ndim):
16495 : */
16496 0 : goto __pyx_L4_break;
16497 :
16498 : /* "View.MemoryView":1122
16499 : *
16500 : * for i in range(ndim - 1, -1, -1):
16501 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16502 : * c_stride = mslice.strides[i]
16503 : * break
16504 : */
16505 : }
16506 : }
16507 0 : __pyx_L4_break:;
16508 :
16509 : /* "View.MemoryView":1126
16510 : * break
16511 : *
16512 : * for i in range(ndim): # <<<<<<<<<<<<<<
16513 : * if mslice.shape[i] > 1:
16514 : * f_stride = mslice.strides[i]
16515 : */
16516 0 : __pyx_t_1 = __pyx_v_ndim;
16517 0 : __pyx_t_3 = __pyx_t_1;
16518 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16519 0 : __pyx_v_i = __pyx_t_4;
16520 :
16521 : /* "View.MemoryView":1127
16522 : *
16523 : * for i in range(ndim):
16524 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16525 : * f_stride = mslice.strides[i]
16526 : * break
16527 : */
16528 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16529 0 : if (__pyx_t_2) {
16530 :
16531 : /* "View.MemoryView":1128
16532 : * for i in range(ndim):
16533 : * if mslice.shape[i] > 1:
16534 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16535 : * break
16536 : *
16537 : */
16538 0 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16539 :
16540 : /* "View.MemoryView":1129
16541 : * if mslice.shape[i] > 1:
16542 : * f_stride = mslice.strides[i]
16543 : * break # <<<<<<<<<<<<<<
16544 : *
16545 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16546 : */
16547 0 : goto __pyx_L7_break;
16548 :
16549 : /* "View.MemoryView":1127
16550 : *
16551 : * for i in range(ndim):
16552 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16553 : * f_stride = mslice.strides[i]
16554 : * break
16555 : */
16556 : }
16557 : }
16558 0 : __pyx_L7_break:;
16559 :
16560 : /* "View.MemoryView":1131
16561 : * break
16562 : *
16563 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16564 : * return 'C'
16565 : * else:
16566 : */
16567 0 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16568 0 : if (__pyx_t_2) {
16569 :
16570 : /* "View.MemoryView":1132
16571 : *
16572 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16573 : * return 'C' # <<<<<<<<<<<<<<
16574 : * else:
16575 : * return 'F'
16576 : */
16577 0 : __pyx_r = 'C';
16578 0 : goto __pyx_L0;
16579 :
16580 : /* "View.MemoryView":1131
16581 : * break
16582 : *
16583 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16584 : * return 'C'
16585 : * else:
16586 : */
16587 : }
16588 :
16589 : /* "View.MemoryView":1134
16590 : * return 'C'
16591 : * else:
16592 : * return 'F' # <<<<<<<<<<<<<<
16593 : *
16594 : * @cython.cdivision(True)
16595 : */
16596 0 : /*else*/ {
16597 0 : __pyx_r = 'F';
16598 0 : goto __pyx_L0;
16599 : }
16600 :
16601 : /* "View.MemoryView":1113
16602 : *
16603 : * @cname('__pyx_get_best_slice_order')
16604 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16605 : * """
16606 : * Figure out the best memory access order for a given slice.
16607 : */
16608 :
16609 : /* function exit code */
16610 0 : __pyx_L0:;
16611 0 : return __pyx_r;
16612 : }
16613 :
16614 : /* "View.MemoryView":1137
16615 : *
16616 : * @cython.cdivision(True)
16617 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16618 : * char *dst_data, Py_ssize_t *dst_strides,
16619 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16620 : */
16621 :
16622 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16623 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16624 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16625 0 : Py_ssize_t __pyx_v_dst_extent;
16626 0 : Py_ssize_t __pyx_v_src_stride;
16627 0 : Py_ssize_t __pyx_v_dst_stride;
16628 0 : int __pyx_t_1;
16629 0 : int __pyx_t_2;
16630 0 : Py_ssize_t __pyx_t_3;
16631 0 : Py_ssize_t __pyx_t_4;
16632 0 : Py_ssize_t __pyx_t_5;
16633 :
16634 : /* "View.MemoryView":1144
16635 : *
16636 : * cdef Py_ssize_t i
16637 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16638 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16639 : * cdef Py_ssize_t src_stride = src_strides[0]
16640 : */
16641 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16642 :
16643 : /* "View.MemoryView":1145
16644 : * cdef Py_ssize_t i
16645 : * cdef Py_ssize_t src_extent = src_shape[0]
16646 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16647 : * cdef Py_ssize_t src_stride = src_strides[0]
16648 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16649 : */
16650 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16651 :
16652 : /* "View.MemoryView":1146
16653 : * cdef Py_ssize_t src_extent = src_shape[0]
16654 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16655 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16656 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16657 : *
16658 : */
16659 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16660 :
16661 : /* "View.MemoryView":1147
16662 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16663 : * cdef Py_ssize_t src_stride = src_strides[0]
16664 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16665 : *
16666 : * if ndim == 1:
16667 : */
16668 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16669 :
16670 : /* "View.MemoryView":1149
16671 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16672 : *
16673 : * if ndim == 1: # <<<<<<<<<<<<<<
16674 : * if (src_stride > 0 and dst_stride > 0 and
16675 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16676 : */
16677 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
16678 0 : if (__pyx_t_1) {
16679 :
16680 : /* "View.MemoryView":1150
16681 : *
16682 : * if ndim == 1:
16683 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16684 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16685 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16686 : */
16687 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
16688 0 : if (__pyx_t_2) {
16689 : } else {
16690 0 : __pyx_t_1 = __pyx_t_2;
16691 0 : goto __pyx_L5_bool_binop_done;
16692 : }
16693 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
16694 0 : if (__pyx_t_2) {
16695 : } else {
16696 0 : __pyx_t_1 = __pyx_t_2;
16697 0 : goto __pyx_L5_bool_binop_done;
16698 : }
16699 :
16700 : /* "View.MemoryView":1151
16701 : * if ndim == 1:
16702 : * if (src_stride > 0 and dst_stride > 0 and
16703 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16704 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16705 : * else:
16706 : */
16707 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16708 0 : if (__pyx_t_2) {
16709 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16710 : }
16711 : __pyx_t_1 = __pyx_t_2;
16712 0 : __pyx_L5_bool_binop_done:;
16713 :
16714 : /* "View.MemoryView":1150
16715 : *
16716 : * if ndim == 1:
16717 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16718 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16719 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16720 : */
16721 0 : if (__pyx_t_1) {
16722 :
16723 : /* "View.MemoryView":1152
16724 : * if (src_stride > 0 and dst_stride > 0 and
16725 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16726 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
16727 : * else:
16728 : * for i in range(dst_extent):
16729 : */
16730 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16731 :
16732 : /* "View.MemoryView":1150
16733 : *
16734 : * if ndim == 1:
16735 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16736 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16737 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16738 : */
16739 0 : goto __pyx_L4;
16740 : }
16741 :
16742 : /* "View.MemoryView":1154
16743 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16744 : * else:
16745 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16746 : * memcpy(dst_data, src_data, itemsize)
16747 : * src_data += src_stride
16748 : */
16749 : /*else*/ {
16750 : __pyx_t_3 = __pyx_v_dst_extent;
16751 : __pyx_t_4 = __pyx_t_3;
16752 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16753 0 : __pyx_v_i = __pyx_t_5;
16754 :
16755 : /* "View.MemoryView":1155
16756 : * else:
16757 : * for i in range(dst_extent):
16758 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16759 : * src_data += src_stride
16760 : * dst_data += dst_stride
16761 : */
16762 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16763 :
16764 : /* "View.MemoryView":1156
16765 : * for i in range(dst_extent):
16766 : * memcpy(dst_data, src_data, itemsize)
16767 : * src_data += src_stride # <<<<<<<<<<<<<<
16768 : * dst_data += dst_stride
16769 : * else:
16770 : */
16771 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16772 :
16773 : /* "View.MemoryView":1157
16774 : * memcpy(dst_data, src_data, itemsize)
16775 : * src_data += src_stride
16776 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16777 : * else:
16778 : * for i in range(dst_extent):
16779 : */
16780 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16781 : }
16782 : }
16783 0 : __pyx_L4:;
16784 :
16785 : /* "View.MemoryView":1149
16786 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16787 : *
16788 : * if ndim == 1: # <<<<<<<<<<<<<<
16789 : * if (src_stride > 0 and dst_stride > 0 and
16790 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16791 : */
16792 0 : goto __pyx_L3;
16793 : }
16794 :
16795 : /* "View.MemoryView":1159
16796 : * dst_data += dst_stride
16797 : * else:
16798 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16799 : * _copy_strided_to_strided(src_data, src_strides + 1,
16800 : * dst_data, dst_strides + 1,
16801 : */
16802 : /*else*/ {
16803 : __pyx_t_3 = __pyx_v_dst_extent;
16804 : __pyx_t_4 = __pyx_t_3;
16805 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16806 0 : __pyx_v_i = __pyx_t_5;
16807 :
16808 : /* "View.MemoryView":1160
16809 : * else:
16810 : * for i in range(dst_extent):
16811 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16812 : * dst_data, dst_strides + 1,
16813 : * src_shape + 1, dst_shape + 1,
16814 : */
16815 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16816 :
16817 : /* "View.MemoryView":1164
16818 : * src_shape + 1, dst_shape + 1,
16819 : * ndim - 1, itemsize)
16820 : * src_data += src_stride # <<<<<<<<<<<<<<
16821 : * dst_data += dst_stride
16822 : *
16823 : */
16824 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16825 :
16826 : /* "View.MemoryView":1165
16827 : * ndim - 1, itemsize)
16828 : * src_data += src_stride
16829 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16830 : *
16831 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16832 : */
16833 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16834 : }
16835 : }
16836 0 : __pyx_L3:;
16837 :
16838 : /* "View.MemoryView":1137
16839 : *
16840 : * @cython.cdivision(True)
16841 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16842 : * char *dst_data, Py_ssize_t *dst_strides,
16843 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16844 : */
16845 :
16846 : /* function exit code */
16847 0 : }
16848 :
16849 : /* "View.MemoryView":1167
16850 : * dst_data += dst_stride
16851 : *
16852 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16853 : * __Pyx_memviewslice *dst,
16854 : * int ndim, size_t itemsize) noexcept nogil:
16855 : */
16856 :
16857 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16858 :
16859 : /* "View.MemoryView":1170
16860 : * __Pyx_memviewslice *dst,
16861 : * int ndim, size_t itemsize) noexcept nogil:
16862 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16863 : * src.shape, dst.shape, ndim, itemsize)
16864 : *
16865 : */
16866 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16867 :
16868 : /* "View.MemoryView":1167
16869 : * dst_data += dst_stride
16870 : *
16871 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16872 : * __Pyx_memviewslice *dst,
16873 : * int ndim, size_t itemsize) noexcept nogil:
16874 : */
16875 :
16876 : /* function exit code */
16877 0 : }
16878 :
16879 : /* "View.MemoryView":1174
16880 : *
16881 : * @cname('__pyx_memoryview_slice_get_size')
16882 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16883 : * "Return the size of the memory occupied by the slice in number of bytes"
16884 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16885 : */
16886 :
16887 0 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16888 0 : Py_ssize_t __pyx_v_shape;
16889 0 : Py_ssize_t __pyx_v_size;
16890 0 : Py_ssize_t __pyx_r;
16891 0 : Py_ssize_t __pyx_t_1;
16892 0 : Py_ssize_t *__pyx_t_2;
16893 0 : Py_ssize_t *__pyx_t_3;
16894 0 : Py_ssize_t *__pyx_t_4;
16895 :
16896 : /* "View.MemoryView":1176
16897 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16898 : * "Return the size of the memory occupied by the slice in number of bytes"
16899 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
16900 : *
16901 : * for shape in src.shape[:ndim]:
16902 : */
16903 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16904 0 : __pyx_v_size = __pyx_t_1;
16905 :
16906 : /* "View.MemoryView":1178
16907 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16908 : *
16909 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16910 : * size *= shape
16911 : *
16912 : */
16913 0 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16914 0 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16915 0 : __pyx_t_2 = __pyx_t_4;
16916 0 : __pyx_v_shape = (__pyx_t_2[0]);
16917 :
16918 : /* "View.MemoryView":1179
16919 : *
16920 : * for shape in src.shape[:ndim]:
16921 : * size *= shape # <<<<<<<<<<<<<<
16922 : *
16923 : * return size
16924 : */
16925 0 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16926 : }
16927 :
16928 : /* "View.MemoryView":1181
16929 : * size *= shape
16930 : *
16931 : * return size # <<<<<<<<<<<<<<
16932 : *
16933 : * @cname('__pyx_fill_contig_strides_array')
16934 : */
16935 0 : __pyx_r = __pyx_v_size;
16936 0 : goto __pyx_L0;
16937 :
16938 : /* "View.MemoryView":1174
16939 : *
16940 : * @cname('__pyx_memoryview_slice_get_size')
16941 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16942 : * "Return the size of the memory occupied by the slice in number of bytes"
16943 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16944 : */
16945 :
16946 : /* function exit code */
16947 0 : __pyx_L0:;
16948 0 : return __pyx_r;
16949 : }
16950 :
16951 : /* "View.MemoryView":1184
16952 : *
16953 : * @cname('__pyx_fill_contig_strides_array')
16954 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16955 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16956 : * int ndim, char order) noexcept nogil:
16957 : */
16958 :
16959 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16960 0 : int __pyx_v_idx;
16961 0 : Py_ssize_t __pyx_r;
16962 0 : int __pyx_t_1;
16963 0 : int __pyx_t_2;
16964 0 : int __pyx_t_3;
16965 0 : int __pyx_t_4;
16966 :
16967 : /* "View.MemoryView":1193
16968 : * cdef int idx
16969 : *
16970 : * if order == 'F': # <<<<<<<<<<<<<<
16971 : * for idx in range(ndim):
16972 : * strides[idx] = stride
16973 : */
16974 0 : __pyx_t_1 = (__pyx_v_order == 'F');
16975 0 : if (__pyx_t_1) {
16976 :
16977 : /* "View.MemoryView":1194
16978 : *
16979 : * if order == 'F':
16980 : * for idx in range(ndim): # <<<<<<<<<<<<<<
16981 : * strides[idx] = stride
16982 : * stride *= shape[idx]
16983 : */
16984 0 : __pyx_t_2 = __pyx_v_ndim;
16985 : __pyx_t_3 = __pyx_t_2;
16986 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16987 0 : __pyx_v_idx = __pyx_t_4;
16988 :
16989 : /* "View.MemoryView":1195
16990 : * if order == 'F':
16991 : * for idx in range(ndim):
16992 : * strides[idx] = stride # <<<<<<<<<<<<<<
16993 : * stride *= shape[idx]
16994 : * else:
16995 : */
16996 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16997 :
16998 : /* "View.MemoryView":1196
16999 : * for idx in range(ndim):
17000 : * strides[idx] = stride
17001 : * stride *= shape[idx] # <<<<<<<<<<<<<<
17002 : * else:
17003 : * for idx in range(ndim - 1, -1, -1):
17004 : */
17005 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17006 : }
17007 :
17008 : /* "View.MemoryView":1193
17009 : * cdef int idx
17010 : *
17011 : * if order == 'F': # <<<<<<<<<<<<<<
17012 : * for idx in range(ndim):
17013 : * strides[idx] = stride
17014 : */
17015 0 : goto __pyx_L3;
17016 : }
17017 :
17018 : /* "View.MemoryView":1198
17019 : * stride *= shape[idx]
17020 : * else:
17021 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17022 : * strides[idx] = stride
17023 : * stride *= shape[idx]
17024 : */
17025 0 : /*else*/ {
17026 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17027 0 : __pyx_v_idx = __pyx_t_2;
17028 :
17029 : /* "View.MemoryView":1199
17030 : * else:
17031 : * for idx in range(ndim - 1, -1, -1):
17032 : * strides[idx] = stride # <<<<<<<<<<<<<<
17033 : * stride *= shape[idx]
17034 : *
17035 : */
17036 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17037 :
17038 : /* "View.MemoryView":1200
17039 : * for idx in range(ndim - 1, -1, -1):
17040 : * strides[idx] = stride
17041 : * stride *= shape[idx] # <<<<<<<<<<<<<<
17042 : *
17043 : * return stride
17044 : */
17045 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17046 : }
17047 : }
17048 0 : __pyx_L3:;
17049 :
17050 : /* "View.MemoryView":1202
17051 : * stride *= shape[idx]
17052 : *
17053 : * return stride # <<<<<<<<<<<<<<
17054 : *
17055 : * @cname('__pyx_memoryview_copy_data_to_temp')
17056 : */
17057 0 : __pyx_r = __pyx_v_stride;
17058 0 : goto __pyx_L0;
17059 :
17060 : /* "View.MemoryView":1184
17061 : *
17062 : * @cname('__pyx_fill_contig_strides_array')
17063 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17064 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17065 : * int ndim, char order) noexcept nogil:
17066 : */
17067 :
17068 : /* function exit code */
17069 0 : __pyx_L0:;
17070 0 : return __pyx_r;
17071 : }
17072 :
17073 : /* "View.MemoryView":1205
17074 : *
17075 : * @cname('__pyx_memoryview_copy_data_to_temp')
17076 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17077 : * __Pyx_memviewslice *tmpslice,
17078 : * char order,
17079 : */
17080 :
17081 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17082 0 : int __pyx_v_i;
17083 0 : void *__pyx_v_result;
17084 0 : size_t __pyx_v_itemsize;
17085 0 : size_t __pyx_v_size;
17086 0 : void *__pyx_r;
17087 0 : Py_ssize_t __pyx_t_1;
17088 0 : int __pyx_t_2;
17089 0 : int __pyx_t_3;
17090 0 : struct __pyx_memoryview_obj *__pyx_t_4;
17091 0 : int __pyx_t_5;
17092 0 : int __pyx_t_6;
17093 0 : int __pyx_lineno = 0;
17094 0 : const char *__pyx_filename = NULL;
17095 0 : int __pyx_clineno = 0;
17096 : #ifdef WITH_THREAD
17097 0 : PyGILState_STATE __pyx_gilstate_save;
17098 : #endif
17099 :
17100 : /* "View.MemoryView":1216
17101 : * cdef void *result
17102 : *
17103 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17104 : * cdef size_t size = slice_get_size(src, ndim)
17105 : *
17106 : */
17107 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17108 0 : __pyx_v_itemsize = __pyx_t_1;
17109 :
17110 : /* "View.MemoryView":1217
17111 : *
17112 : * cdef size_t itemsize = src.memview.view.itemsize
17113 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17114 : *
17115 : * result = malloc(size)
17116 : */
17117 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17118 :
17119 : /* "View.MemoryView":1219
17120 : * cdef size_t size = slice_get_size(src, ndim)
17121 : *
17122 : * result = malloc(size) # <<<<<<<<<<<<<<
17123 : * if not result:
17124 : * _err_no_memory()
17125 : */
17126 0 : __pyx_v_result = malloc(__pyx_v_size);
17127 :
17128 : /* "View.MemoryView":1220
17129 : *
17130 : * result = malloc(size)
17131 : * if not result: # <<<<<<<<<<<<<<
17132 : * _err_no_memory()
17133 : *
17134 : */
17135 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
17136 0 : if (__pyx_t_2) {
17137 :
17138 : /* "View.MemoryView":1221
17139 : * result = malloc(size)
17140 : * if not result:
17141 : * _err_no_memory() # <<<<<<<<<<<<<<
17142 : *
17143 : *
17144 : */
17145 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
17146 :
17147 : /* "View.MemoryView":1220
17148 : *
17149 : * result = malloc(size)
17150 : * if not result: # <<<<<<<<<<<<<<
17151 : * _err_no_memory()
17152 : *
17153 : */
17154 : }
17155 :
17156 : /* "View.MemoryView":1224
17157 : *
17158 : *
17159 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
17160 : * tmpslice.memview = src.memview
17161 : * for i in range(ndim):
17162 : */
17163 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17164 :
17165 : /* "View.MemoryView":1225
17166 : *
17167 : * tmpslice.data = <char *> result
17168 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
17169 : * for i in range(ndim):
17170 : * tmpslice.shape[i] = src.shape[i]
17171 : */
17172 0 : __pyx_t_4 = __pyx_v_src->memview;
17173 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
17174 :
17175 : /* "View.MemoryView":1226
17176 : * tmpslice.data = <char *> result
17177 : * tmpslice.memview = src.memview
17178 : * for i in range(ndim): # <<<<<<<<<<<<<<
17179 : * tmpslice.shape[i] = src.shape[i]
17180 : * tmpslice.suboffsets[i] = -1
17181 : */
17182 0 : __pyx_t_3 = __pyx_v_ndim;
17183 0 : __pyx_t_5 = __pyx_t_3;
17184 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17185 0 : __pyx_v_i = __pyx_t_6;
17186 :
17187 : /* "View.MemoryView":1227
17188 : * tmpslice.memview = src.memview
17189 : * for i in range(ndim):
17190 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
17191 : * tmpslice.suboffsets[i] = -1
17192 : *
17193 : */
17194 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17195 :
17196 : /* "View.MemoryView":1228
17197 : * for i in range(ndim):
17198 : * tmpslice.shape[i] = src.shape[i]
17199 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17200 : *
17201 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
17202 : */
17203 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
17204 : }
17205 :
17206 : /* "View.MemoryView":1230
17207 : * tmpslice.suboffsets[i] = -1
17208 : *
17209 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
17210 : *
17211 : *
17212 : */
17213 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
17214 :
17215 : /* "View.MemoryView":1233
17216 : *
17217 : *
17218 : * for i in range(ndim): # <<<<<<<<<<<<<<
17219 : * if tmpslice.shape[i] == 1:
17220 : * tmpslice.strides[i] = 0
17221 : */
17222 0 : __pyx_t_3 = __pyx_v_ndim;
17223 0 : __pyx_t_5 = __pyx_t_3;
17224 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17225 0 : __pyx_v_i = __pyx_t_6;
17226 :
17227 : /* "View.MemoryView":1234
17228 : *
17229 : * for i in range(ndim):
17230 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17231 : * tmpslice.strides[i] = 0
17232 : *
17233 : */
17234 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
17235 0 : if (__pyx_t_2) {
17236 :
17237 : /* "View.MemoryView":1235
17238 : * for i in range(ndim):
17239 : * if tmpslice.shape[i] == 1:
17240 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
17241 : *
17242 : * if slice_is_contig(src[0], order, ndim):
17243 : */
17244 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17245 :
17246 : /* "View.MemoryView":1234
17247 : *
17248 : * for i in range(ndim):
17249 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17250 : * tmpslice.strides[i] = 0
17251 : *
17252 : */
17253 : }
17254 : }
17255 :
17256 : /* "View.MemoryView":1237
17257 : * tmpslice.strides[i] = 0
17258 : *
17259 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17260 : * memcpy(result, src.data, size)
17261 : * else:
17262 : */
17263 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
17264 0 : if (__pyx_t_2) {
17265 :
17266 : /* "View.MemoryView":1238
17267 : *
17268 : * if slice_is_contig(src[0], order, ndim):
17269 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
17270 : * else:
17271 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17272 : */
17273 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17274 :
17275 : /* "View.MemoryView":1237
17276 : * tmpslice.strides[i] = 0
17277 : *
17278 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17279 : * memcpy(result, src.data, size)
17280 : * else:
17281 : */
17282 0 : goto __pyx_L9;
17283 : }
17284 :
17285 : /* "View.MemoryView":1240
17286 : * memcpy(result, src.data, size)
17287 : * else:
17288 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
17289 : *
17290 : * return result
17291 : */
17292 0 : /*else*/ {
17293 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17294 : }
17295 0 : __pyx_L9:;
17296 :
17297 : /* "View.MemoryView":1242
17298 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17299 : *
17300 : * return result # <<<<<<<<<<<<<<
17301 : *
17302 : *
17303 : */
17304 0 : __pyx_r = __pyx_v_result;
17305 0 : goto __pyx_L0;
17306 :
17307 : /* "View.MemoryView":1205
17308 : *
17309 : * @cname('__pyx_memoryview_copy_data_to_temp')
17310 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17311 : * __Pyx_memviewslice *tmpslice,
17312 : * char order,
17313 : */
17314 :
17315 : /* function exit code */
17316 0 : __pyx_L1_error:;
17317 : #ifdef WITH_THREAD
17318 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17319 : #endif
17320 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17321 0 : __pyx_r = NULL;
17322 : #ifdef WITH_THREAD
17323 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17324 : #endif
17325 0 : __pyx_L0:;
17326 0 : return __pyx_r;
17327 : }
17328 :
17329 : /* "View.MemoryView":1247
17330 : *
17331 : * @cname('__pyx_memoryview_err_extents')
17332 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
17333 : * Py_ssize_t extent2) except -1 with gil:
17334 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
17335 : */
17336 :
17337 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17338 0 : int __pyx_r;
17339 : __Pyx_RefNannyDeclarations
17340 0 : PyObject *__pyx_t_1 = NULL;
17341 0 : Py_ssize_t __pyx_t_2;
17342 0 : Py_UCS4 __pyx_t_3;
17343 0 : PyObject *__pyx_t_4 = NULL;
17344 0 : int __pyx_lineno = 0;
17345 0 : const char *__pyx_filename = NULL;
17346 0 : int __pyx_clineno = 0;
17347 : #ifdef WITH_THREAD
17348 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17349 : #endif
17350 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
17351 :
17352 : /* "View.MemoryView":1249
17353 : * cdef int _err_extents(int i, Py_ssize_t extent1,
17354 : * Py_ssize_t extent2) except -1 with gil:
17355 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
17356 : *
17357 : * @cname('__pyx_memoryview_err_dim')
17358 : */
17359 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
17360 0 : __Pyx_GOTREF(__pyx_t_1);
17361 0 : __pyx_t_2 = 0;
17362 0 : __pyx_t_3 = 127;
17363 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
17364 0 : __pyx_t_2 += 35;
17365 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
17366 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
17367 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17368 0 : __Pyx_GOTREF(__pyx_t_4);
17369 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
17370 0 : __Pyx_GIVEREF(__pyx_t_4);
17371 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
17372 0 : __pyx_t_4 = 0;
17373 0 : __Pyx_INCREF(__pyx_kp_u_got);
17374 0 : __pyx_t_2 += 6;
17375 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
17376 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
17377 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17378 0 : __Pyx_GOTREF(__pyx_t_4);
17379 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
17380 0 : __Pyx_GIVEREF(__pyx_t_4);
17381 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
17382 0 : __pyx_t_4 = 0;
17383 0 : __Pyx_INCREF(__pyx_kp_u_and);
17384 0 : __pyx_t_2 += 5;
17385 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
17386 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
17387 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17388 0 : __Pyx_GOTREF(__pyx_t_4);
17389 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
17390 0 : __Pyx_GIVEREF(__pyx_t_4);
17391 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
17392 0 : __pyx_t_4 = 0;
17393 0 : __Pyx_INCREF(__pyx_kp_u__7);
17394 0 : __pyx_t_2 += 1;
17395 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
17396 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
17397 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17398 0 : __Pyx_GOTREF(__pyx_t_4);
17399 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17400 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
17401 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17402 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
17403 :
17404 : /* "View.MemoryView":1247
17405 : *
17406 : * @cname('__pyx_memoryview_err_extents')
17407 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
17408 : * Py_ssize_t extent2) except -1 with gil:
17409 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
17410 : */
17411 :
17412 : /* function exit code */
17413 0 : __pyx_L1_error:;
17414 0 : __Pyx_XDECREF(__pyx_t_1);
17415 0 : __Pyx_XDECREF(__pyx_t_4);
17416 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17417 0 : __pyx_r = -1;
17418 0 : __Pyx_RefNannyFinishContext();
17419 : #ifdef WITH_THREAD
17420 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17421 : #endif
17422 0 : return __pyx_r;
17423 : }
17424 :
17425 : /* "View.MemoryView":1252
17426 : *
17427 : * @cname('__pyx_memoryview_err_dim')
17428 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
17429 : * raise <object>error, msg % dim
17430 : *
17431 : */
17432 :
17433 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
17434 0 : int __pyx_r;
17435 : __Pyx_RefNannyDeclarations
17436 0 : PyObject *__pyx_t_1 = NULL;
17437 0 : PyObject *__pyx_t_2 = NULL;
17438 0 : int __pyx_lineno = 0;
17439 0 : const char *__pyx_filename = NULL;
17440 0 : int __pyx_clineno = 0;
17441 : #ifdef WITH_THREAD
17442 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17443 : #endif
17444 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
17445 0 : __Pyx_INCREF(__pyx_v_msg);
17446 :
17447 : /* "View.MemoryView":1253
17448 : * @cname('__pyx_memoryview_err_dim')
17449 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
17450 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
17451 : *
17452 : * @cname('__pyx_memoryview_err')
17453 : */
17454 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
17455 0 : __Pyx_GOTREF(__pyx_t_1);
17456 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
17457 0 : __Pyx_GOTREF(__pyx_t_2);
17458 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17459 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
17460 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17461 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
17462 :
17463 : /* "View.MemoryView":1252
17464 : *
17465 : * @cname('__pyx_memoryview_err_dim')
17466 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
17467 : * raise <object>error, msg % dim
17468 : *
17469 : */
17470 :
17471 : /* function exit code */
17472 0 : __pyx_L1_error:;
17473 0 : __Pyx_XDECREF(__pyx_t_1);
17474 0 : __Pyx_XDECREF(__pyx_t_2);
17475 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
17476 0 : __pyx_r = -1;
17477 0 : __Pyx_XDECREF(__pyx_v_msg);
17478 0 : __Pyx_RefNannyFinishContext();
17479 : #ifdef WITH_THREAD
17480 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17481 : #endif
17482 0 : return __pyx_r;
17483 : }
17484 :
17485 : /* "View.MemoryView":1256
17486 : *
17487 : * @cname('__pyx_memoryview_err')
17488 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
17489 : * raise <object>error, msg
17490 : *
17491 : */
17492 :
17493 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
17494 0 : int __pyx_r;
17495 : __Pyx_RefNannyDeclarations
17496 0 : int __pyx_lineno = 0;
17497 0 : const char *__pyx_filename = NULL;
17498 0 : int __pyx_clineno = 0;
17499 : #ifdef WITH_THREAD
17500 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17501 : #endif
17502 0 : __Pyx_RefNannySetupContext("_err", 0);
17503 0 : __Pyx_INCREF(__pyx_v_msg);
17504 :
17505 : /* "View.MemoryView":1257
17506 : * @cname('__pyx_memoryview_err')
17507 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
17508 : * raise <object>error, msg # <<<<<<<<<<<<<<
17509 : *
17510 : * @cname('__pyx_memoryview_err_no_memory')
17511 : */
17512 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
17513 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
17514 :
17515 : /* "View.MemoryView":1256
17516 : *
17517 : * @cname('__pyx_memoryview_err')
17518 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
17519 : * raise <object>error, msg
17520 : *
17521 : */
17522 :
17523 : /* function exit code */
17524 0 : __pyx_L1_error:;
17525 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17526 0 : __pyx_r = -1;
17527 0 : __Pyx_XDECREF(__pyx_v_msg);
17528 0 : __Pyx_RefNannyFinishContext();
17529 : #ifdef WITH_THREAD
17530 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17531 : #endif
17532 0 : return __pyx_r;
17533 : }
17534 :
17535 : /* "View.MemoryView":1260
17536 : *
17537 : * @cname('__pyx_memoryview_err_no_memory')
17538 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
17539 : * raise MemoryError
17540 : *
17541 : */
17542 :
17543 0 : static int __pyx_memoryview_err_no_memory(void) {
17544 0 : int __pyx_r;
17545 0 : int __pyx_lineno = 0;
17546 0 : const char *__pyx_filename = NULL;
17547 0 : int __pyx_clineno = 0;
17548 : #ifdef WITH_THREAD
17549 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17550 : #endif
17551 :
17552 : /* "View.MemoryView":1261
17553 : * @cname('__pyx_memoryview_err_no_memory')
17554 : * cdef int _err_no_memory() except -1 with gil:
17555 : * raise MemoryError # <<<<<<<<<<<<<<
17556 : *
17557 : *
17558 : */
17559 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
17560 :
17561 : /* "View.MemoryView":1260
17562 : *
17563 : * @cname('__pyx_memoryview_err_no_memory')
17564 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
17565 : * raise MemoryError
17566 : *
17567 : */
17568 :
17569 : /* function exit code */
17570 0 : __pyx_L1_error:;
17571 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17572 0 : __pyx_r = -1;
17573 : #ifdef WITH_THREAD
17574 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17575 : #endif
17576 0 : return __pyx_r;
17577 : }
17578 :
17579 : /* "View.MemoryView":1265
17580 : *
17581 : * @cname('__pyx_memoryview_copy_contents')
17582 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17583 : * __Pyx_memviewslice dst,
17584 : * int src_ndim, int dst_ndim,
17585 : */
17586 :
17587 0 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17588 0 : void *__pyx_v_tmpdata;
17589 0 : size_t __pyx_v_itemsize;
17590 0 : int __pyx_v_i;
17591 0 : char __pyx_v_order;
17592 0 : int __pyx_v_broadcasting;
17593 0 : int __pyx_v_direct_copy;
17594 0 : __Pyx_memviewslice __pyx_v_tmp;
17595 0 : int __pyx_v_ndim;
17596 0 : int __pyx_r;
17597 0 : Py_ssize_t __pyx_t_1;
17598 0 : int __pyx_t_2;
17599 0 : int __pyx_t_3;
17600 0 : int __pyx_t_4;
17601 0 : int __pyx_t_5;
17602 0 : int __pyx_t_6;
17603 0 : void *__pyx_t_7;
17604 0 : int __pyx_lineno = 0;
17605 0 : const char *__pyx_filename = NULL;
17606 0 : int __pyx_clineno = 0;
17607 : #ifdef WITH_THREAD
17608 0 : PyGILState_STATE __pyx_gilstate_save;
17609 : #endif
17610 :
17611 : /* "View.MemoryView":1273
17612 : * Check for overlapping memory and verify the shapes.
17613 : * """
17614 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17615 : * cdef size_t itemsize = src.memview.view.itemsize
17616 : * cdef int i
17617 : */
17618 0 : __pyx_v_tmpdata = NULL;
17619 :
17620 : /* "View.MemoryView":1274
17621 : * """
17622 : * cdef void *tmpdata = NULL
17623 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17624 : * cdef int i
17625 : * cdef char order = get_best_order(&src, src_ndim)
17626 : */
17627 0 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17628 0 : __pyx_v_itemsize = __pyx_t_1;
17629 :
17630 : /* "View.MemoryView":1276
17631 : * cdef size_t itemsize = src.memview.view.itemsize
17632 : * cdef int i
17633 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17634 : * cdef bint broadcasting = False
17635 : * cdef bint direct_copy = False
17636 : */
17637 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17638 :
17639 : /* "View.MemoryView":1277
17640 : * cdef int i
17641 : * cdef char order = get_best_order(&src, src_ndim)
17642 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17643 : * cdef bint direct_copy = False
17644 : * cdef __Pyx_memviewslice tmp
17645 : */
17646 0 : __pyx_v_broadcasting = 0;
17647 :
17648 : /* "View.MemoryView":1278
17649 : * cdef char order = get_best_order(&src, src_ndim)
17650 : * cdef bint broadcasting = False
17651 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17652 : * cdef __Pyx_memviewslice tmp
17653 : *
17654 : */
17655 0 : __pyx_v_direct_copy = 0;
17656 :
17657 : /* "View.MemoryView":1281
17658 : * cdef __Pyx_memviewslice tmp
17659 : *
17660 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17661 : * broadcast_leading(&src, src_ndim, dst_ndim)
17662 : * elif dst_ndim < src_ndim:
17663 : */
17664 0 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17665 0 : if (__pyx_t_2) {
17666 :
17667 : /* "View.MemoryView":1282
17668 : *
17669 : * if src_ndim < dst_ndim:
17670 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17671 : * elif dst_ndim < src_ndim:
17672 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17673 : */
17674 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17675 :
17676 : /* "View.MemoryView":1281
17677 : * cdef __Pyx_memviewslice tmp
17678 : *
17679 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17680 : * broadcast_leading(&src, src_ndim, dst_ndim)
17681 : * elif dst_ndim < src_ndim:
17682 : */
17683 0 : goto __pyx_L3;
17684 : }
17685 :
17686 : /* "View.MemoryView":1283
17687 : * if src_ndim < dst_ndim:
17688 : * broadcast_leading(&src, src_ndim, dst_ndim)
17689 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17690 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17691 : *
17692 : */
17693 0 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17694 0 : if (__pyx_t_2) {
17695 :
17696 : /* "View.MemoryView":1284
17697 : * broadcast_leading(&src, src_ndim, dst_ndim)
17698 : * elif dst_ndim < src_ndim:
17699 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17700 : *
17701 : * cdef int ndim = max(src_ndim, dst_ndim)
17702 : */
17703 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17704 :
17705 : /* "View.MemoryView":1283
17706 : * if src_ndim < dst_ndim:
17707 : * broadcast_leading(&src, src_ndim, dst_ndim)
17708 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17709 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17710 : *
17711 : */
17712 : }
17713 0 : __pyx_L3:;
17714 :
17715 : /* "View.MemoryView":1286
17716 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17717 : *
17718 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17719 : *
17720 : * for i in range(ndim):
17721 : */
17722 0 : __pyx_t_3 = __pyx_v_dst_ndim;
17723 0 : __pyx_t_4 = __pyx_v_src_ndim;
17724 0 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
17725 0 : if (__pyx_t_2) {
17726 : __pyx_t_5 = __pyx_t_3;
17727 : } else {
17728 : __pyx_t_5 = __pyx_t_4;
17729 : }
17730 0 : __pyx_v_ndim = __pyx_t_5;
17731 :
17732 : /* "View.MemoryView":1288
17733 : * cdef int ndim = max(src_ndim, dst_ndim)
17734 : *
17735 : * for i in range(ndim): # <<<<<<<<<<<<<<
17736 : * if src.shape[i] != dst.shape[i]:
17737 : * if src.shape[i] == 1:
17738 : */
17739 0 : __pyx_t_5 = __pyx_v_ndim;
17740 0 : __pyx_t_3 = __pyx_t_5;
17741 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17742 0 : __pyx_v_i = __pyx_t_4;
17743 :
17744 : /* "View.MemoryView":1289
17745 : *
17746 : * for i in range(ndim):
17747 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17748 : * if src.shape[i] == 1:
17749 : * broadcasting = True
17750 : */
17751 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17752 0 : if (__pyx_t_2) {
17753 :
17754 : /* "View.MemoryView":1290
17755 : * for i in range(ndim):
17756 : * if src.shape[i] != dst.shape[i]:
17757 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17758 : * broadcasting = True
17759 : * src.strides[i] = 0
17760 : */
17761 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17762 0 : if (__pyx_t_2) {
17763 :
17764 : /* "View.MemoryView":1291
17765 : * if src.shape[i] != dst.shape[i]:
17766 : * if src.shape[i] == 1:
17767 : * broadcasting = True # <<<<<<<<<<<<<<
17768 : * src.strides[i] = 0
17769 : * else:
17770 : */
17771 0 : __pyx_v_broadcasting = 1;
17772 :
17773 : /* "View.MemoryView":1292
17774 : * if src.shape[i] == 1:
17775 : * broadcasting = True
17776 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
17777 : * else:
17778 : * _err_extents(i, dst.shape[i], src.shape[i])
17779 : */
17780 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
17781 :
17782 : /* "View.MemoryView":1290
17783 : * for i in range(ndim):
17784 : * if src.shape[i] != dst.shape[i]:
17785 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17786 : * broadcasting = True
17787 : * src.strides[i] = 0
17788 : */
17789 0 : goto __pyx_L7;
17790 : }
17791 :
17792 : /* "View.MemoryView":1294
17793 : * src.strides[i] = 0
17794 : * else:
17795 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17796 : *
17797 : * if src.suboffsets[i] >= 0:
17798 : */
17799 0 : /*else*/ {
17800 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
17801 : }
17802 0 : __pyx_L7:;
17803 :
17804 : /* "View.MemoryView":1289
17805 : *
17806 : * for i in range(ndim):
17807 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17808 : * if src.shape[i] == 1:
17809 : * broadcasting = True
17810 : */
17811 : }
17812 :
17813 : /* "View.MemoryView":1296
17814 : * _err_extents(i, dst.shape[i], src.shape[i])
17815 : *
17816 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17817 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17818 : *
17819 : */
17820 0 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17821 0 : if (__pyx_t_2) {
17822 :
17823 : /* "View.MemoryView":1297
17824 : *
17825 : * if src.suboffsets[i] >= 0:
17826 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17827 : *
17828 : * if slices_overlap(&src, &dst, ndim, itemsize):
17829 : */
17830 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
17831 :
17832 : /* "View.MemoryView":1296
17833 : * _err_extents(i, dst.shape[i], src.shape[i])
17834 : *
17835 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17836 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17837 : *
17838 : */
17839 : }
17840 : }
17841 :
17842 : /* "View.MemoryView":1299
17843 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17844 : *
17845 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17846 : *
17847 : * if not slice_is_contig(src, order, ndim):
17848 : */
17849 0 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17850 0 : if (__pyx_t_2) {
17851 :
17852 : /* "View.MemoryView":1301
17853 : * if slices_overlap(&src, &dst, ndim, itemsize):
17854 : *
17855 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17856 : * order = get_best_order(&dst, ndim)
17857 : *
17858 : */
17859 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17860 0 : if (__pyx_t_2) {
17861 :
17862 : /* "View.MemoryView":1302
17863 : *
17864 : * if not slice_is_contig(src, order, ndim):
17865 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17866 : *
17867 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17868 : */
17869 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17870 :
17871 : /* "View.MemoryView":1301
17872 : * if slices_overlap(&src, &dst, ndim, itemsize):
17873 : *
17874 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17875 : * order = get_best_order(&dst, ndim)
17876 : *
17877 : */
17878 : }
17879 :
17880 : /* "View.MemoryView":1304
17881 : * order = get_best_order(&dst, ndim)
17882 : *
17883 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17884 : * src = tmp
17885 : *
17886 : */
17887 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
17888 0 : __pyx_v_tmpdata = __pyx_t_7;
17889 :
17890 : /* "View.MemoryView":1305
17891 : *
17892 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17893 : * src = tmp # <<<<<<<<<<<<<<
17894 : *
17895 : * if not broadcasting:
17896 : */
17897 0 : __pyx_v_src = __pyx_v_tmp;
17898 :
17899 : /* "View.MemoryView":1299
17900 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17901 : *
17902 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17903 : *
17904 : * if not slice_is_contig(src, order, ndim):
17905 : */
17906 : }
17907 :
17908 : /* "View.MemoryView":1307
17909 : * src = tmp
17910 : *
17911 : * if not broadcasting: # <<<<<<<<<<<<<<
17912 : *
17913 : *
17914 : */
17915 0 : __pyx_t_2 = (!__pyx_v_broadcasting);
17916 0 : if (__pyx_t_2) {
17917 :
17918 : /* "View.MemoryView":1310
17919 : *
17920 : *
17921 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17922 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17923 : * elif slice_is_contig(src, 'F', ndim):
17924 : */
17925 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17926 0 : if (__pyx_t_2) {
17927 :
17928 : /* "View.MemoryView":1311
17929 : *
17930 : * if slice_is_contig(src, 'C', ndim):
17931 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17932 : * elif slice_is_contig(src, 'F', ndim):
17933 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17934 : */
17935 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17936 :
17937 : /* "View.MemoryView":1310
17938 : *
17939 : *
17940 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17941 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17942 : * elif slice_is_contig(src, 'F', ndim):
17943 : */
17944 0 : goto __pyx_L12;
17945 : }
17946 :
17947 : /* "View.MemoryView":1312
17948 : * if slice_is_contig(src, 'C', ndim):
17949 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17950 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17951 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17952 : *
17953 : */
17954 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17955 0 : if (__pyx_t_2) {
17956 :
17957 : /* "View.MemoryView":1313
17958 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17959 : * elif slice_is_contig(src, 'F', ndim):
17960 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17961 : *
17962 : * if direct_copy:
17963 : */
17964 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17965 :
17966 : /* "View.MemoryView":1312
17967 : * if slice_is_contig(src, 'C', ndim):
17968 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17969 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17970 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17971 : *
17972 : */
17973 : }
17974 0 : __pyx_L12:;
17975 :
17976 : /* "View.MemoryView":1315
17977 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17978 : *
17979 : * if direct_copy: # <<<<<<<<<<<<<<
17980 : *
17981 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17982 : */
17983 0 : if (__pyx_v_direct_copy) {
17984 :
17985 : /* "View.MemoryView":1317
17986 : * if direct_copy:
17987 : *
17988 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17989 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17990 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17991 : */
17992 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17993 :
17994 : /* "View.MemoryView":1318
17995 : *
17996 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17997 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17998 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17999 : * free(tmpdata)
18000 : */
18001 0 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18002 :
18003 : /* "View.MemoryView":1319
18004 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18005 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18006 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18007 : * free(tmpdata)
18008 : * return 0
18009 : */
18010 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18011 :
18012 : /* "View.MemoryView":1320
18013 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18014 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18015 : * free(tmpdata) # <<<<<<<<<<<<<<
18016 : * return 0
18017 : *
18018 : */
18019 0 : free(__pyx_v_tmpdata);
18020 :
18021 : /* "View.MemoryView":1321
18022 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18023 : * free(tmpdata)
18024 : * return 0 # <<<<<<<<<<<<<<
18025 : *
18026 : * if order == 'F' == get_best_order(&dst, ndim):
18027 : */
18028 0 : __pyx_r = 0;
18029 0 : goto __pyx_L0;
18030 :
18031 : /* "View.MemoryView":1315
18032 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18033 : *
18034 : * if direct_copy: # <<<<<<<<<<<<<<
18035 : *
18036 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18037 : */
18038 : }
18039 :
18040 : /* "View.MemoryView":1307
18041 : * src = tmp
18042 : *
18043 : * if not broadcasting: # <<<<<<<<<<<<<<
18044 : *
18045 : *
18046 : */
18047 : }
18048 :
18049 : /* "View.MemoryView":1323
18050 : * return 0
18051 : *
18052 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18053 : *
18054 : *
18055 : */
18056 0 : __pyx_t_2 = (__pyx_v_order == 'F');
18057 0 : if (__pyx_t_2) {
18058 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18059 : }
18060 0 : if (__pyx_t_2) {
18061 :
18062 : /* "View.MemoryView":1326
18063 : *
18064 : *
18065 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
18066 : * transpose_memslice(&dst)
18067 : *
18068 : */
18069 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
18070 :
18071 : /* "View.MemoryView":1327
18072 : *
18073 : * transpose_memslice(&src)
18074 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
18075 : *
18076 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18077 : */
18078 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
18079 :
18080 : /* "View.MemoryView":1323
18081 : * return 0
18082 : *
18083 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18084 : *
18085 : *
18086 : */
18087 : }
18088 :
18089 : /* "View.MemoryView":1329
18090 : * transpose_memslice(&dst)
18091 : *
18092 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18093 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18094 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18095 : */
18096 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18097 :
18098 : /* "View.MemoryView":1330
18099 : *
18100 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18101 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
18102 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18103 : *
18104 : */
18105 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18106 :
18107 : /* "View.MemoryView":1331
18108 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18109 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18110 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18111 : *
18112 : * free(tmpdata)
18113 : */
18114 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18115 :
18116 : /* "View.MemoryView":1333
18117 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18118 : *
18119 : * free(tmpdata) # <<<<<<<<<<<<<<
18120 : * return 0
18121 : *
18122 : */
18123 0 : free(__pyx_v_tmpdata);
18124 :
18125 : /* "View.MemoryView":1334
18126 : *
18127 : * free(tmpdata)
18128 : * return 0 # <<<<<<<<<<<<<<
18129 : *
18130 : * @cname('__pyx_memoryview_broadcast_leading')
18131 : */
18132 0 : __pyx_r = 0;
18133 0 : goto __pyx_L0;
18134 :
18135 : /* "View.MemoryView":1265
18136 : *
18137 : * @cname('__pyx_memoryview_copy_contents')
18138 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18139 : * __Pyx_memviewslice dst,
18140 : * int src_ndim, int dst_ndim,
18141 : */
18142 :
18143 : /* function exit code */
18144 0 : __pyx_L1_error:;
18145 : #ifdef WITH_THREAD
18146 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18147 : #endif
18148 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18149 0 : __pyx_r = -1;
18150 : #ifdef WITH_THREAD
18151 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18152 : #endif
18153 0 : __pyx_L0:;
18154 0 : return __pyx_r;
18155 : }
18156 :
18157 : /* "View.MemoryView":1337
18158 : *
18159 : * @cname('__pyx_memoryview_broadcast_leading')
18160 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18161 : * int ndim,
18162 : * int ndim_other) noexcept nogil:
18163 : */
18164 :
18165 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
18166 0 : int __pyx_v_i;
18167 0 : int __pyx_v_offset;
18168 0 : int __pyx_t_1;
18169 0 : int __pyx_t_2;
18170 0 : int __pyx_t_3;
18171 :
18172 : /* "View.MemoryView":1341
18173 : * int ndim_other) noexcept nogil:
18174 : * cdef int i
18175 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
18176 : *
18177 : * for i in range(ndim - 1, -1, -1):
18178 : */
18179 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18180 :
18181 : /* "View.MemoryView":1343
18182 : * cdef int offset = ndim_other - ndim
18183 : *
18184 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18185 : * mslice.shape[i + offset] = mslice.shape[i]
18186 : * mslice.strides[i + offset] = mslice.strides[i]
18187 : */
18188 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18189 0 : __pyx_v_i = __pyx_t_1;
18190 :
18191 : /* "View.MemoryView":1344
18192 : *
18193 : * for i in range(ndim - 1, -1, -1):
18194 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
18195 : * mslice.strides[i + offset] = mslice.strides[i]
18196 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18197 : */
18198 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18199 :
18200 : /* "View.MemoryView":1345
18201 : * for i in range(ndim - 1, -1, -1):
18202 : * mslice.shape[i + offset] = mslice.shape[i]
18203 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
18204 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18205 : *
18206 : */
18207 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18208 :
18209 : /* "View.MemoryView":1346
18210 : * mslice.shape[i + offset] = mslice.shape[i]
18211 : * mslice.strides[i + offset] = mslice.strides[i]
18212 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
18213 : *
18214 : * for i in range(offset):
18215 : */
18216 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18217 : }
18218 :
18219 : /* "View.MemoryView":1348
18220 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18221 : *
18222 : * for i in range(offset): # <<<<<<<<<<<<<<
18223 : * mslice.shape[i] = 1
18224 : * mslice.strides[i] = mslice.strides[0]
18225 : */
18226 0 : __pyx_t_1 = __pyx_v_offset;
18227 : __pyx_t_2 = __pyx_t_1;
18228 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18229 0 : __pyx_v_i = __pyx_t_3;
18230 :
18231 : /* "View.MemoryView":1349
18232 : *
18233 : * for i in range(offset):
18234 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
18235 : * mslice.strides[i] = mslice.strides[0]
18236 : * mslice.suboffsets[i] = -1
18237 : */
18238 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18239 :
18240 : /* "View.MemoryView":1350
18241 : * for i in range(offset):
18242 : * mslice.shape[i] = 1
18243 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18244 : * mslice.suboffsets[i] = -1
18245 : *
18246 : */
18247 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18248 :
18249 : /* "View.MemoryView":1351
18250 : * mslice.shape[i] = 1
18251 : * mslice.strides[i] = mslice.strides[0]
18252 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18253 : *
18254 : *
18255 : */
18256 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18257 : }
18258 :
18259 : /* "View.MemoryView":1337
18260 : *
18261 : * @cname('__pyx_memoryview_broadcast_leading')
18262 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18263 : * int ndim,
18264 : * int ndim_other) noexcept nogil:
18265 : */
18266 :
18267 : /* function exit code */
18268 0 : }
18269 :
18270 : /* "View.MemoryView":1359
18271 : *
18272 : * @cname('__pyx_memoryview_refcount_copying')
18273 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
18274 : *
18275 : * if dtype_is_object:
18276 : */
18277 :
18278 0 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
18279 :
18280 : /* "View.MemoryView":1361
18281 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18282 : *
18283 : * if dtype_is_object: # <<<<<<<<<<<<<<
18284 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18285 : *
18286 : */
18287 0 : if (__pyx_v_dtype_is_object) {
18288 :
18289 : /* "View.MemoryView":1362
18290 : *
18291 : * if dtype_is_object:
18292 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
18293 : *
18294 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18295 : */
18296 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18297 :
18298 : /* "View.MemoryView":1361
18299 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18300 : *
18301 : * if dtype_is_object: # <<<<<<<<<<<<<<
18302 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18303 : *
18304 : */
18305 : }
18306 :
18307 : /* "View.MemoryView":1359
18308 : *
18309 : * @cname('__pyx_memoryview_refcount_copying')
18310 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
18311 : *
18312 : * if dtype_is_object:
18313 : */
18314 :
18315 : /* function exit code */
18316 0 : }
18317 :
18318 : /* "View.MemoryView":1365
18319 : *
18320 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18321 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18322 : * Py_ssize_t *strides, int ndim,
18323 : * bint inc) noexcept with gil:
18324 : */
18325 :
18326 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18327 : #ifdef WITH_THREAD
18328 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18329 : #endif
18330 :
18331 : /* "View.MemoryView":1368
18332 : * Py_ssize_t *strides, int ndim,
18333 : * bint inc) noexcept with gil:
18334 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
18335 : *
18336 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
18337 : */
18338 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18339 :
18340 : /* "View.MemoryView":1365
18341 : *
18342 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18343 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18344 : * Py_ssize_t *strides, int ndim,
18345 : * bint inc) noexcept with gil:
18346 : */
18347 :
18348 : /* function exit code */
18349 : #ifdef WITH_THREAD
18350 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18351 : #endif
18352 0 : }
18353 :
18354 : /* "View.MemoryView":1371
18355 : *
18356 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
18357 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18358 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18359 : * cdef Py_ssize_t i
18360 : */
18361 :
18362 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18363 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18364 0 : Py_ssize_t __pyx_v_stride;
18365 0 : Py_ssize_t __pyx_t_1;
18366 0 : Py_ssize_t __pyx_t_2;
18367 0 : Py_ssize_t __pyx_t_3;
18368 0 : int __pyx_t_4;
18369 :
18370 : /* "View.MemoryView":1374
18371 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18372 : * cdef Py_ssize_t i
18373 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18374 : *
18375 : * for i in range(shape[0]):
18376 : */
18377 0 : __pyx_v_stride = (__pyx_v_strides[0]);
18378 :
18379 : /* "View.MemoryView":1376
18380 : * cdef Py_ssize_t stride = strides[0]
18381 : *
18382 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
18383 : * if ndim == 1:
18384 : * if inc:
18385 : */
18386 0 : __pyx_t_1 = (__pyx_v_shape[0]);
18387 0 : __pyx_t_2 = __pyx_t_1;
18388 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18389 0 : __pyx_v_i = __pyx_t_3;
18390 :
18391 : /* "View.MemoryView":1377
18392 : *
18393 : * for i in range(shape[0]):
18394 : * if ndim == 1: # <<<<<<<<<<<<<<
18395 : * if inc:
18396 : * Py_INCREF((<PyObject **> data)[0])
18397 : */
18398 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
18399 0 : if (__pyx_t_4) {
18400 :
18401 : /* "View.MemoryView":1378
18402 : * for i in range(shape[0]):
18403 : * if ndim == 1:
18404 : * if inc: # <<<<<<<<<<<<<<
18405 : * Py_INCREF((<PyObject **> data)[0])
18406 : * else:
18407 : */
18408 0 : if (__pyx_v_inc) {
18409 :
18410 : /* "View.MemoryView":1379
18411 : * if ndim == 1:
18412 : * if inc:
18413 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18414 : * else:
18415 : * Py_DECREF((<PyObject **> data)[0])
18416 : */
18417 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18418 :
18419 : /* "View.MemoryView":1378
18420 : * for i in range(shape[0]):
18421 : * if ndim == 1:
18422 : * if inc: # <<<<<<<<<<<<<<
18423 : * Py_INCREF((<PyObject **> data)[0])
18424 : * else:
18425 : */
18426 0 : goto __pyx_L6;
18427 : }
18428 :
18429 : /* "View.MemoryView":1381
18430 : * Py_INCREF((<PyObject **> data)[0])
18431 : * else:
18432 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18433 : * else:
18434 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18435 : */
18436 0 : /*else*/ {
18437 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18438 : }
18439 0 : __pyx_L6:;
18440 :
18441 : /* "View.MemoryView":1377
18442 : *
18443 : * for i in range(shape[0]):
18444 : * if ndim == 1: # <<<<<<<<<<<<<<
18445 : * if inc:
18446 : * Py_INCREF((<PyObject **> data)[0])
18447 : */
18448 0 : goto __pyx_L5;
18449 : }
18450 :
18451 : /* "View.MemoryView":1383
18452 : * Py_DECREF((<PyObject **> data)[0])
18453 : * else:
18454 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
18455 : *
18456 : * data += stride
18457 : */
18458 0 : /*else*/ {
18459 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18460 : }
18461 0 : __pyx_L5:;
18462 :
18463 : /* "View.MemoryView":1385
18464 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18465 : *
18466 : * data += stride # <<<<<<<<<<<<<<
18467 : *
18468 : *
18469 : */
18470 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18471 : }
18472 :
18473 : /* "View.MemoryView":1371
18474 : *
18475 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
18476 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18477 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18478 : * cdef Py_ssize_t i
18479 : */
18480 :
18481 : /* function exit code */
18482 0 : }
18483 :
18484 : /* "View.MemoryView":1391
18485 : *
18486 : * @cname('__pyx_memoryview_slice_assign_scalar')
18487 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
18488 : * size_t itemsize, void *item,
18489 : * bint dtype_is_object) noexcept nogil:
18490 : */
18491 :
18492 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18493 :
18494 : /* "View.MemoryView":1394
18495 : * size_t itemsize, void *item,
18496 : * bint dtype_is_object) noexcept nogil:
18497 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18498 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18499 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18500 : */
18501 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18502 :
18503 : /* "View.MemoryView":1395
18504 : * bint dtype_is_object) noexcept nogil:
18505 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18506 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18507 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18508 : *
18509 : */
18510 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18511 :
18512 : /* "View.MemoryView":1396
18513 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18514 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18515 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18516 : *
18517 : *
18518 : */
18519 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18520 :
18521 : /* "View.MemoryView":1391
18522 : *
18523 : * @cname('__pyx_memoryview_slice_assign_scalar')
18524 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
18525 : * size_t itemsize, void *item,
18526 : * bint dtype_is_object) noexcept nogil:
18527 : */
18528 :
18529 : /* function exit code */
18530 0 : }
18531 :
18532 : /* "View.MemoryView":1400
18533 : *
18534 : * @cname('__pyx_memoryview__slice_assign_scalar')
18535 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18536 : * Py_ssize_t *strides, int ndim,
18537 : * size_t itemsize, void *item) noexcept nogil:
18538 : */
18539 :
18540 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18541 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18542 0 : Py_ssize_t __pyx_v_stride;
18543 0 : Py_ssize_t __pyx_v_extent;
18544 0 : int __pyx_t_1;
18545 0 : Py_ssize_t __pyx_t_2;
18546 0 : Py_ssize_t __pyx_t_3;
18547 0 : Py_ssize_t __pyx_t_4;
18548 :
18549 : /* "View.MemoryView":1404
18550 : * size_t itemsize, void *item) noexcept nogil:
18551 : * cdef Py_ssize_t i
18552 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18553 : * cdef Py_ssize_t extent = shape[0]
18554 : *
18555 : */
18556 0 : __pyx_v_stride = (__pyx_v_strides[0]);
18557 :
18558 : /* "View.MemoryView":1405
18559 : * cdef Py_ssize_t i
18560 : * cdef Py_ssize_t stride = strides[0]
18561 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18562 : *
18563 : * if ndim == 1:
18564 : */
18565 0 : __pyx_v_extent = (__pyx_v_shape[0]);
18566 :
18567 : /* "View.MemoryView":1407
18568 : * cdef Py_ssize_t extent = shape[0]
18569 : *
18570 : * if ndim == 1: # <<<<<<<<<<<<<<
18571 : * for i in range(extent):
18572 : * memcpy(data, item, itemsize)
18573 : */
18574 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
18575 0 : if (__pyx_t_1) {
18576 :
18577 : /* "View.MemoryView":1408
18578 : *
18579 : * if ndim == 1:
18580 : * for i in range(extent): # <<<<<<<<<<<<<<
18581 : * memcpy(data, item, itemsize)
18582 : * data += stride
18583 : */
18584 : __pyx_t_2 = __pyx_v_extent;
18585 : __pyx_t_3 = __pyx_t_2;
18586 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18587 0 : __pyx_v_i = __pyx_t_4;
18588 :
18589 : /* "View.MemoryView":1409
18590 : * if ndim == 1:
18591 : * for i in range(extent):
18592 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18593 : * data += stride
18594 : * else:
18595 : */
18596 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18597 :
18598 : /* "View.MemoryView":1410
18599 : * for i in range(extent):
18600 : * memcpy(data, item, itemsize)
18601 : * data += stride # <<<<<<<<<<<<<<
18602 : * else:
18603 : * for i in range(extent):
18604 : */
18605 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18606 : }
18607 :
18608 : /* "View.MemoryView":1407
18609 : * cdef Py_ssize_t extent = shape[0]
18610 : *
18611 : * if ndim == 1: # <<<<<<<<<<<<<<
18612 : * for i in range(extent):
18613 : * memcpy(data, item, itemsize)
18614 : */
18615 0 : goto __pyx_L3;
18616 : }
18617 :
18618 : /* "View.MemoryView":1412
18619 : * data += stride
18620 : * else:
18621 : * for i in range(extent): # <<<<<<<<<<<<<<
18622 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18623 : * data += stride
18624 : */
18625 : /*else*/ {
18626 : __pyx_t_2 = __pyx_v_extent;
18627 : __pyx_t_3 = __pyx_t_2;
18628 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18629 0 : __pyx_v_i = __pyx_t_4;
18630 :
18631 : /* "View.MemoryView":1413
18632 : * else:
18633 : * for i in range(extent):
18634 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18635 : * data += stride
18636 : *
18637 : */
18638 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18639 :
18640 : /* "View.MemoryView":1414
18641 : * for i in range(extent):
18642 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18643 : * data += stride # <<<<<<<<<<<<<<
18644 : *
18645 : *
18646 : */
18647 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18648 : }
18649 : }
18650 0 : __pyx_L3:;
18651 :
18652 : /* "View.MemoryView":1400
18653 : *
18654 : * @cname('__pyx_memoryview__slice_assign_scalar')
18655 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18656 : * Py_ssize_t *strides, int ndim,
18657 : * size_t itemsize, void *item) noexcept nogil:
18658 : */
18659 :
18660 : /* function exit code */
18661 0 : }
18662 :
18663 : /* "(tree fragment)":1
18664 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18665 : * cdef object __pyx_PickleError
18666 : * cdef object __pyx_result
18667 : */
18668 :
18669 : /* Python wrapper */
18670 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18671 : #if CYTHON_METH_FASTCALL
18672 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18673 : #else
18674 : PyObject *__pyx_args, PyObject *__pyx_kwds
18675 : #endif
18676 : ); /*proto*/
18677 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18678 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18679 : #if CYTHON_METH_FASTCALL
18680 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18681 : #else
18682 : PyObject *__pyx_args, PyObject *__pyx_kwds
18683 : #endif
18684 : ) {
18685 0 : PyObject *__pyx_v___pyx_type = 0;
18686 0 : long __pyx_v___pyx_checksum;
18687 0 : PyObject *__pyx_v___pyx_state = 0;
18688 : #if !CYTHON_METH_FASTCALL
18689 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18690 : #endif
18691 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18692 0 : PyObject* values[3] = {0,0,0};
18693 0 : int __pyx_lineno = 0;
18694 0 : const char *__pyx_filename = NULL;
18695 0 : int __pyx_clineno = 0;
18696 0 : PyObject *__pyx_r = 0;
18697 : __Pyx_RefNannyDeclarations
18698 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18699 : #if !CYTHON_METH_FASTCALL
18700 : #if CYTHON_ASSUME_SAFE_MACROS
18701 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18702 : #else
18703 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18704 : #endif
18705 : #endif
18706 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18707 0 : {
18708 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18709 0 : if (__pyx_kwds) {
18710 0 : Py_ssize_t kw_args;
18711 0 : switch (__pyx_nargs) {
18712 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18713 0 : CYTHON_FALLTHROUGH;
18714 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18715 0 : CYTHON_FALLTHROUGH;
18716 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18717 0 : CYTHON_FALLTHROUGH;
18718 0 : case 0: break;
18719 0 : default: goto __pyx_L5_argtuple_error;
18720 : }
18721 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
18722 0 : switch (__pyx_nargs) {
18723 0 : case 0:
18724 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
18725 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
18726 0 : kw_args--;
18727 : }
18728 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18729 0 : else goto __pyx_L5_argtuple_error;
18730 0 : CYTHON_FALLTHROUGH;
18731 0 : case 1:
18732 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
18733 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
18734 0 : kw_args--;
18735 : }
18736 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18737 : else {
18738 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
18739 : }
18740 0 : CYTHON_FALLTHROUGH;
18741 0 : case 2:
18742 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
18743 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
18744 0 : kw_args--;
18745 : }
18746 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18747 : else {
18748 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
18749 : }
18750 : }
18751 0 : if (unlikely(kw_args > 0)) {
18752 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
18753 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18754 : }
18755 0 : } else if (unlikely(__pyx_nargs != 3)) {
18756 0 : goto __pyx_L5_argtuple_error;
18757 : } else {
18758 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18759 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18760 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18761 : }
18762 0 : __pyx_v___pyx_type = values[0];
18763 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18764 0 : __pyx_v___pyx_state = values[2];
18765 : }
18766 0 : goto __pyx_L6_skip;
18767 0 : __pyx_L5_argtuple_error:;
18768 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
18769 0 : __pyx_L6_skip:;
18770 0 : goto __pyx_L4_argument_unpacking_done;
18771 0 : __pyx_L3_error:;
18772 0 : {
18773 0 : Py_ssize_t __pyx_temp;
18774 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18775 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18776 : }
18777 : }
18778 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18779 : __Pyx_RefNannyFinishContext();
18780 : return NULL;
18781 0 : __pyx_L4_argument_unpacking_done:;
18782 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18783 :
18784 : /* function exit code */
18785 : {
18786 : Py_ssize_t __pyx_temp;
18787 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18788 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18789 : }
18790 : }
18791 : __Pyx_RefNannyFinishContext();
18792 : return __pyx_r;
18793 : }
18794 :
18795 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18796 0 : PyObject *__pyx_v___pyx_PickleError = 0;
18797 0 : PyObject *__pyx_v___pyx_result = 0;
18798 0 : PyObject *__pyx_r = NULL;
18799 : __Pyx_RefNannyDeclarations
18800 0 : PyObject *__pyx_t_1 = NULL;
18801 0 : int __pyx_t_2;
18802 0 : PyObject *__pyx_t_3 = NULL;
18803 0 : PyObject *__pyx_t_4 = NULL;
18804 0 : unsigned int __pyx_t_5;
18805 0 : int __pyx_lineno = 0;
18806 0 : const char *__pyx_filename = NULL;
18807 0 : int __pyx_clineno = 0;
18808 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
18809 :
18810 : /* "(tree fragment)":4
18811 : * cdef object __pyx_PickleError
18812 : * cdef object __pyx_result
18813 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18814 : * from pickle import PickleError as __pyx_PickleError
18815 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18816 : */
18817 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18818 0 : __Pyx_GOTREF(__pyx_t_1);
18819 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
18820 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18821 0 : if (__pyx_t_2) {
18822 :
18823 : /* "(tree fragment)":5
18824 : * cdef object __pyx_result
18825 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18826 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18827 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18828 : * __pyx_result = Enum.__new__(__pyx_type)
18829 : */
18830 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18831 0 : __Pyx_GOTREF(__pyx_t_1);
18832 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
18833 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
18834 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
18835 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18836 0 : __Pyx_GOTREF(__pyx_t_3);
18837 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18838 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18839 0 : __Pyx_GOTREF(__pyx_t_1);
18840 0 : __Pyx_INCREF(__pyx_t_1);
18841 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
18842 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18843 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18844 :
18845 : /* "(tree fragment)":6
18846 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18847 : * from pickle import PickleError as __pyx_PickleError
18848 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
18849 : * __pyx_result = Enum.__new__(__pyx_type)
18850 : * if __pyx_state is not None:
18851 : */
18852 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18853 0 : __Pyx_GOTREF(__pyx_t_3);
18854 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
18855 0 : __Pyx_GOTREF(__pyx_t_1);
18856 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18857 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
18858 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18859 0 : __PYX_ERR(1, 6, __pyx_L1_error)
18860 :
18861 : /* "(tree fragment)":4
18862 : * cdef object __pyx_PickleError
18863 : * cdef object __pyx_result
18864 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18865 : * from pickle import PickleError as __pyx_PickleError
18866 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18867 : */
18868 : }
18869 :
18870 : /* "(tree fragment)":7
18871 : * from pickle import PickleError as __pyx_PickleError
18872 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18873 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18874 : * if __pyx_state is not None:
18875 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18876 : */
18877 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18878 0 : __Pyx_GOTREF(__pyx_t_3);
18879 0 : __pyx_t_4 = NULL;
18880 0 : __pyx_t_5 = 0;
18881 : #if CYTHON_UNPACK_METHODS
18882 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
18883 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
18884 0 : if (likely(__pyx_t_4)) {
18885 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18886 0 : __Pyx_INCREF(__pyx_t_4);
18887 0 : __Pyx_INCREF(function);
18888 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
18889 : __pyx_t_5 = 1;
18890 : }
18891 : }
18892 : #endif
18893 0 : {
18894 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
18895 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
18896 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18897 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
18898 0 : __Pyx_GOTREF(__pyx_t_1);
18899 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18900 : }
18901 0 : __pyx_v___pyx_result = __pyx_t_1;
18902 0 : __pyx_t_1 = 0;
18903 :
18904 : /* "(tree fragment)":8
18905 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18906 : * __pyx_result = Enum.__new__(__pyx_type)
18907 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18908 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18909 : * return __pyx_result
18910 : */
18911 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
18912 0 : if (__pyx_t_2) {
18913 :
18914 : /* "(tree fragment)":9
18915 : * __pyx_result = Enum.__new__(__pyx_type)
18916 : * if __pyx_state is not None:
18917 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18918 : * return __pyx_result
18919 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18920 : */
18921 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
18922 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
18923 0 : __Pyx_GOTREF(__pyx_t_1);
18924 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18925 :
18926 : /* "(tree fragment)":8
18927 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18928 : * __pyx_result = Enum.__new__(__pyx_type)
18929 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18930 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18931 : * return __pyx_result
18932 : */
18933 : }
18934 :
18935 : /* "(tree fragment)":10
18936 : * if __pyx_state is not None:
18937 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18938 : * return __pyx_result # <<<<<<<<<<<<<<
18939 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18940 : * __pyx_result.name = __pyx_state[0]
18941 : */
18942 0 : __Pyx_XDECREF(__pyx_r);
18943 0 : __Pyx_INCREF(__pyx_v___pyx_result);
18944 0 : __pyx_r = __pyx_v___pyx_result;
18945 0 : goto __pyx_L0;
18946 :
18947 : /* "(tree fragment)":1
18948 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18949 : * cdef object __pyx_PickleError
18950 : * cdef object __pyx_result
18951 : */
18952 :
18953 : /* function exit code */
18954 0 : __pyx_L1_error:;
18955 0 : __Pyx_XDECREF(__pyx_t_1);
18956 0 : __Pyx_XDECREF(__pyx_t_3);
18957 0 : __Pyx_XDECREF(__pyx_t_4);
18958 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18959 0 : __pyx_r = NULL;
18960 0 : __pyx_L0:;
18961 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18962 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
18963 0 : __Pyx_XGIVEREF(__pyx_r);
18964 0 : __Pyx_RefNannyFinishContext();
18965 0 : return __pyx_r;
18966 : }
18967 :
18968 : /* "(tree fragment)":11
18969 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18970 : * return __pyx_result
18971 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18972 : * __pyx_result.name = __pyx_state[0]
18973 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18974 : */
18975 :
18976 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18977 0 : PyObject *__pyx_r = NULL;
18978 : __Pyx_RefNannyDeclarations
18979 0 : PyObject *__pyx_t_1 = NULL;
18980 0 : int __pyx_t_2;
18981 0 : Py_ssize_t __pyx_t_3;
18982 0 : int __pyx_t_4;
18983 0 : PyObject *__pyx_t_5 = NULL;
18984 0 : PyObject *__pyx_t_6 = NULL;
18985 0 : PyObject *__pyx_t_7 = NULL;
18986 0 : unsigned int __pyx_t_8;
18987 0 : int __pyx_lineno = 0;
18988 0 : const char *__pyx_filename = NULL;
18989 0 : int __pyx_clineno = 0;
18990 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
18991 :
18992 : /* "(tree fragment)":12
18993 : * return __pyx_result
18994 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18995 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18996 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18997 : * __pyx_result.__dict__.update(__pyx_state[1])
18998 : */
18999 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19000 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19001 0 : __PYX_ERR(1, 12, __pyx_L1_error)
19002 : }
19003 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
19004 0 : __Pyx_GOTREF(__pyx_t_1);
19005 0 : __Pyx_GIVEREF(__pyx_t_1);
19006 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
19007 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
19008 0 : __pyx_v___pyx_result->name = __pyx_t_1;
19009 0 : __pyx_t_1 = 0;
19010 :
19011 : /* "(tree fragment)":13
19012 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19013 : * __pyx_result.name = __pyx_state[0]
19014 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19015 : * __pyx_result.__dict__.update(__pyx_state[1])
19016 : */
19017 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19018 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
19019 : __PYX_ERR(1, 13, __pyx_L1_error)
19020 : }
19021 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19022 0 : __pyx_t_4 = (__pyx_t_3 > 1);
19023 0 : if (__pyx_t_4) {
19024 : } else {
19025 0 : __pyx_t_2 = __pyx_t_4;
19026 0 : goto __pyx_L4_bool_binop_done;
19027 : }
19028 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19029 : __pyx_t_2 = __pyx_t_4;
19030 0 : __pyx_L4_bool_binop_done:;
19031 0 : if (__pyx_t_2) {
19032 :
19033 : /* "(tree fragment)":14
19034 : * __pyx_result.name = __pyx_state[0]
19035 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19036 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
19037 : */
19038 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
19039 0 : __Pyx_GOTREF(__pyx_t_5);
19040 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
19041 0 : __Pyx_GOTREF(__pyx_t_6);
19042 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19043 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19044 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19045 : __PYX_ERR(1, 14, __pyx_L1_error)
19046 : }
19047 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
19048 0 : __Pyx_GOTREF(__pyx_t_5);
19049 0 : __pyx_t_7 = NULL;
19050 0 : __pyx_t_8 = 0;
19051 : #if CYTHON_UNPACK_METHODS
19052 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
19053 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
19054 0 : if (likely(__pyx_t_7)) {
19055 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19056 0 : __Pyx_INCREF(__pyx_t_7);
19057 0 : __Pyx_INCREF(function);
19058 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
19059 : __pyx_t_8 = 1;
19060 : }
19061 : }
19062 : #endif
19063 0 : {
19064 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
19065 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
19066 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19067 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19068 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
19069 0 : __Pyx_GOTREF(__pyx_t_1);
19070 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19071 : }
19072 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19073 :
19074 : /* "(tree fragment)":13
19075 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19076 : * __pyx_result.name = __pyx_state[0]
19077 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19078 : * __pyx_result.__dict__.update(__pyx_state[1])
19079 : */
19080 : }
19081 :
19082 : /* "(tree fragment)":11
19083 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19084 : * return __pyx_result
19085 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19086 : * __pyx_result.name = __pyx_state[0]
19087 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19088 : */
19089 :
19090 : /* function exit code */
19091 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19092 0 : goto __pyx_L0;
19093 0 : __pyx_L1_error:;
19094 0 : __Pyx_XDECREF(__pyx_t_1);
19095 0 : __Pyx_XDECREF(__pyx_t_5);
19096 0 : __Pyx_XDECREF(__pyx_t_6);
19097 0 : __Pyx_XDECREF(__pyx_t_7);
19098 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19099 0 : __pyx_r = 0;
19100 0 : __pyx_L0:;
19101 0 : __Pyx_XGIVEREF(__pyx_r);
19102 0 : __Pyx_RefNannyFinishContext();
19103 0 : return __pyx_r;
19104 : }
19105 :
19106 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
19107 : *
19108 : * @property
19109 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
19110 : * return PyDataType_ELSIZE(self)
19111 : *
19112 : */
19113 :
19114 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
19115 : npy_intp __pyx_r;
19116 :
19117 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
19118 : * @property
19119 : * cdef inline npy_intp itemsize(self) noexcept nogil:
19120 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19121 : *
19122 : * @property
19123 : */
19124 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19125 : goto __pyx_L0;
19126 :
19127 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
19128 : *
19129 : * @property
19130 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
19131 : * return PyDataType_ELSIZE(self)
19132 : *
19133 : */
19134 :
19135 : /* function exit code */
19136 : __pyx_L0:;
19137 : return __pyx_r;
19138 : }
19139 :
19140 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
19141 : *
19142 : * @property
19143 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
19144 : * return PyDataType_ALIGNMENT(self)
19145 : *
19146 : */
19147 :
19148 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
19149 : npy_intp __pyx_r;
19150 :
19151 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
19152 : * @property
19153 : * cdef inline npy_intp alignment(self) noexcept nogil:
19154 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19155 : *
19156 : * # Use fields/names with care as they may be NULL. You must check
19157 : */
19158 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19159 : goto __pyx_L0;
19160 :
19161 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
19162 : *
19163 : * @property
19164 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
19165 : * return PyDataType_ALIGNMENT(self)
19166 : *
19167 : */
19168 :
19169 : /* function exit code */
19170 : __pyx_L0:;
19171 : return __pyx_r;
19172 : }
19173 :
19174 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
19175 : * # for this using PyDataType_HASFIELDS.
19176 : * @property
19177 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
19178 : * return <object>PyDataType_FIELDS(self)
19179 : *
19180 : */
19181 :
19182 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
19183 : PyObject *__pyx_r = NULL;
19184 : __Pyx_RefNannyDeclarations
19185 : PyObject *__pyx_t_1;
19186 : __Pyx_RefNannySetupContext("fields", 1);
19187 :
19188 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
19189 : * @property
19190 : * cdef inline object fields(self):
19191 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19192 : *
19193 : * @property
19194 : */
19195 : __Pyx_XDECREF(__pyx_r);
19196 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19197 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
19198 : __pyx_r = ((PyObject *)__pyx_t_1);
19199 : goto __pyx_L0;
19200 :
19201 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
19202 : * # for this using PyDataType_HASFIELDS.
19203 : * @property
19204 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
19205 : * return <object>PyDataType_FIELDS(self)
19206 : *
19207 : */
19208 :
19209 : /* function exit code */
19210 : __pyx_L0:;
19211 : __Pyx_XGIVEREF(__pyx_r);
19212 : __Pyx_RefNannyFinishContext();
19213 : return __pyx_r;
19214 : }
19215 :
19216 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
19217 : *
19218 : * @property
19219 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
19220 : * return <tuple>PyDataType_NAMES(self)
19221 : *
19222 : */
19223 :
19224 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
19225 : PyObject *__pyx_r = NULL;
19226 : __Pyx_RefNannyDeclarations
19227 : PyObject *__pyx_t_1;
19228 : __Pyx_RefNannySetupContext("names", 1);
19229 :
19230 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
19231 : * @property
19232 : * cdef inline tuple names(self):
19233 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19234 : *
19235 : * # Use PyDataType_HASSUBARRAY to test whether this field is
19236 : */
19237 : __Pyx_XDECREF(__pyx_r);
19238 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19239 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
19240 : __pyx_r = ((PyObject*)__pyx_t_1);
19241 : goto __pyx_L0;
19242 :
19243 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
19244 : *
19245 : * @property
19246 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
19247 : * return <tuple>PyDataType_NAMES(self)
19248 : *
19249 : */
19250 :
19251 : /* function exit code */
19252 : __pyx_L0:;
19253 : __Pyx_XGIVEREF(__pyx_r);
19254 : __Pyx_RefNannyFinishContext();
19255 : return __pyx_r;
19256 : }
19257 :
19258 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
19259 : * # this field via the inline helper method PyDataType_SHAPE.
19260 : * @property
19261 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
19262 : * return PyDataType_SUBARRAY(self)
19263 : *
19264 : */
19265 :
19266 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
19267 : PyArray_ArrayDescr *__pyx_r;
19268 :
19269 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
19270 : * @property
19271 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19272 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19273 : *
19274 : * @property
19275 : */
19276 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19277 : goto __pyx_L0;
19278 :
19279 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
19280 : * # this field via the inline helper method PyDataType_SHAPE.
19281 : * @property
19282 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
19283 : * return PyDataType_SUBARRAY(self)
19284 : *
19285 : */
19286 :
19287 : /* function exit code */
19288 : __pyx_L0:;
19289 : return __pyx_r;
19290 : }
19291 :
19292 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
19293 : *
19294 : * @property
19295 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
19296 : * """The data types flags."""
19297 : * return PyDataType_FLAGS(self)
19298 : */
19299 :
19300 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
19301 : npy_uint64 __pyx_r;
19302 :
19303 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
19304 : * cdef inline npy_uint64 flags(self) noexcept nogil:
19305 : * """The data types flags."""
19306 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19307 : *
19308 : *
19309 : */
19310 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19311 : goto __pyx_L0;
19312 :
19313 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
19314 : *
19315 : * @property
19316 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
19317 : * """The data types flags."""
19318 : * return PyDataType_FLAGS(self)
19319 : */
19320 :
19321 : /* function exit code */
19322 : __pyx_L0:;
19323 : return __pyx_r;
19324 : }
19325 :
19326 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
19327 : *
19328 : * @property
19329 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
19330 : * """The number of arrays that need to be broadcast to the same shape."""
19331 : * return PyArray_MultiIter_NUMITER(self)
19332 : */
19333 :
19334 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
19335 : int __pyx_r;
19336 :
19337 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
19338 : * cdef inline int numiter(self) noexcept nogil:
19339 : * """The number of arrays that need to be broadcast to the same shape."""
19340 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19341 : *
19342 : * @property
19343 : */
19344 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19345 : goto __pyx_L0;
19346 :
19347 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
19348 : *
19349 : * @property
19350 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
19351 : * """The number of arrays that need to be broadcast to the same shape."""
19352 : * return PyArray_MultiIter_NUMITER(self)
19353 : */
19354 :
19355 : /* function exit code */
19356 : __pyx_L0:;
19357 : return __pyx_r;
19358 : }
19359 :
19360 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
19361 : *
19362 : * @property
19363 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19364 : * """The total broadcasted size."""
19365 : * return PyArray_MultiIter_SIZE(self)
19366 : */
19367 :
19368 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
19369 : npy_intp __pyx_r;
19370 :
19371 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
19372 : * cdef inline npy_intp size(self) noexcept nogil:
19373 : * """The total broadcasted size."""
19374 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19375 : *
19376 : * @property
19377 : */
19378 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19379 : goto __pyx_L0;
19380 :
19381 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
19382 : *
19383 : * @property
19384 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19385 : * """The total broadcasted size."""
19386 : * return PyArray_MultiIter_SIZE(self)
19387 : */
19388 :
19389 : /* function exit code */
19390 : __pyx_L0:;
19391 : return __pyx_r;
19392 : }
19393 :
19394 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
19395 : *
19396 : * @property
19397 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
19398 : * """The current (1-d) index into the broadcasted result."""
19399 : * return PyArray_MultiIter_INDEX(self)
19400 : */
19401 :
19402 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
19403 : npy_intp __pyx_r;
19404 :
19405 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
19406 : * cdef inline npy_intp index(self) noexcept nogil:
19407 : * """The current (1-d) index into the broadcasted result."""
19408 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
19409 : *
19410 : * @property
19411 : */
19412 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19413 : goto __pyx_L0;
19414 :
19415 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
19416 : *
19417 : * @property
19418 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
19419 : * """The current (1-d) index into the broadcasted result."""
19420 : * return PyArray_MultiIter_INDEX(self)
19421 : */
19422 :
19423 : /* function exit code */
19424 : __pyx_L0:;
19425 : return __pyx_r;
19426 : }
19427 :
19428 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
19429 : *
19430 : * @property
19431 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
19432 : * """The number of dimensions in the broadcasted result."""
19433 : * return PyArray_MultiIter_NDIM(self)
19434 : */
19435 :
19436 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
19437 : int __pyx_r;
19438 :
19439 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
19440 : * cdef inline int nd(self) noexcept nogil:
19441 : * """The number of dimensions in the broadcasted result."""
19442 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
19443 : *
19444 : * @property
19445 : */
19446 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19447 : goto __pyx_L0;
19448 :
19449 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
19450 : *
19451 : * @property
19452 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
19453 : * """The number of dimensions in the broadcasted result."""
19454 : * return PyArray_MultiIter_NDIM(self)
19455 : */
19456 :
19457 : /* function exit code */
19458 : __pyx_L0:;
19459 : return __pyx_r;
19460 : }
19461 :
19462 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
19463 : *
19464 : * @property
19465 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
19466 : * """The shape of the broadcasted result."""
19467 : * return PyArray_MultiIter_DIMS(self)
19468 : */
19469 :
19470 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
19471 : npy_intp *__pyx_r;
19472 :
19473 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
19474 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
19475 : * """The shape of the broadcasted result."""
19476 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
19477 : *
19478 : * @property
19479 : */
19480 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19481 : goto __pyx_L0;
19482 :
19483 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
19484 : *
19485 : * @property
19486 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
19487 : * """The shape of the broadcasted result."""
19488 : * return PyArray_MultiIter_DIMS(self)
19489 : */
19490 :
19491 : /* function exit code */
19492 : __pyx_L0:;
19493 : return __pyx_r;
19494 : }
19495 :
19496 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
19497 : *
19498 : * @property
19499 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
19500 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19501 : * On return, the iterators are adjusted for broadcasting."""
19502 : */
19503 :
19504 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
19505 : void **__pyx_r;
19506 :
19507 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
19508 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19509 : * On return, the iterators are adjusted for broadcasting."""
19510 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
19511 : *
19512 : *
19513 : */
19514 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19515 : goto __pyx_L0;
19516 :
19517 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
19518 : *
19519 : * @property
19520 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
19521 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19522 : * On return, the iterators are adjusted for broadcasting."""
19523 : */
19524 :
19525 : /* function exit code */
19526 : __pyx_L0:;
19527 : return __pyx_r;
19528 : }
19529 :
19530 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
19531 : *
19532 : * @property
19533 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
19534 : * """Returns a borrowed reference to the object owning the data/memory.
19535 : * """
19536 : */
19537 :
19538 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
19539 : PyObject *__pyx_r;
19540 :
19541 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
19542 : * """Returns a borrowed reference to the object owning the data/memory.
19543 : * """
19544 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19545 : *
19546 : * @property
19547 : */
19548 : __pyx_r = PyArray_BASE(__pyx_v_self);
19549 : goto __pyx_L0;
19550 :
19551 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
19552 : *
19553 : * @property
19554 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
19555 : * """Returns a borrowed reference to the object owning the data/memory.
19556 : * """
19557 : */
19558 :
19559 : /* function exit code */
19560 : __pyx_L0:;
19561 : return __pyx_r;
19562 : }
19563 :
19564 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19565 : *
19566 : * @property
19567 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19568 : * """Returns an owned reference to the dtype of the array.
19569 : * """
19570 : */
19571 :
19572 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
19573 : PyArray_Descr *__pyx_r = NULL;
19574 : __Pyx_RefNannyDeclarations
19575 : PyArray_Descr *__pyx_t_1;
19576 : __Pyx_RefNannySetupContext("descr", 1);
19577 :
19578 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
19579 : * """Returns an owned reference to the dtype of the array.
19580 : * """
19581 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19582 : *
19583 : * @property
19584 : */
19585 : __Pyx_XDECREF((PyObject *)__pyx_r);
19586 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19587 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19588 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19589 : goto __pyx_L0;
19590 :
19591 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19592 : *
19593 : * @property
19594 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19595 : * """Returns an owned reference to the dtype of the array.
19596 : * """
19597 : */
19598 :
19599 : /* function exit code */
19600 : __pyx_L0:;
19601 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
19602 : __Pyx_RefNannyFinishContext();
19603 : return __pyx_r;
19604 : }
19605 :
19606 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19607 : *
19608 : * @property
19609 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19610 : * """Returns the number of dimensions in the array.
19611 : * """
19612 : */
19613 :
19614 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19615 : int __pyx_r;
19616 :
19617 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
19618 : * """Returns the number of dimensions in the array.
19619 : * """
19620 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19621 : *
19622 : * @property
19623 : */
19624 : __pyx_r = PyArray_NDIM(__pyx_v_self);
19625 : goto __pyx_L0;
19626 :
19627 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19628 : *
19629 : * @property
19630 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19631 : * """Returns the number of dimensions in the array.
19632 : * """
19633 : */
19634 :
19635 : /* function exit code */
19636 : __pyx_L0:;
19637 : return __pyx_r;
19638 : }
19639 :
19640 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19641 : *
19642 : * @property
19643 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19644 : * """Returns a pointer to the dimensions/shape of the array.
19645 : * The number of elements matches the number of dimensions of the array (ndim).
19646 : */
19647 :
19648 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19649 : npy_intp *__pyx_r;
19650 :
19651 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
19652 : * Can return NULL for 0-dimensional arrays.
19653 : * """
19654 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19655 : *
19656 : * @property
19657 : */
19658 : __pyx_r = PyArray_DIMS(__pyx_v_self);
19659 : goto __pyx_L0;
19660 :
19661 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19662 : *
19663 : * @property
19664 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19665 : * """Returns a pointer to the dimensions/shape of the array.
19666 : * The number of elements matches the number of dimensions of the array (ndim).
19667 : */
19668 :
19669 : /* function exit code */
19670 : __pyx_L0:;
19671 : return __pyx_r;
19672 : }
19673 :
19674 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19675 : *
19676 : * @property
19677 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19678 : * """Returns a pointer to the strides of the array.
19679 : * The number of elements matches the number of dimensions of the array (ndim).
19680 : */
19681 :
19682 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19683 : npy_intp *__pyx_r;
19684 :
19685 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
19686 : * The number of elements matches the number of dimensions of the array (ndim).
19687 : * """
19688 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19689 : *
19690 : * @property
19691 : */
19692 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
19693 : goto __pyx_L0;
19694 :
19695 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19696 : *
19697 : * @property
19698 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19699 : * """Returns a pointer to the strides of the array.
19700 : * The number of elements matches the number of dimensions of the array (ndim).
19701 : */
19702 :
19703 : /* function exit code */
19704 : __pyx_L0:;
19705 : return __pyx_r;
19706 : }
19707 :
19708 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19709 : *
19710 : * @property
19711 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19712 : * """Returns the total size (in number of elements) of the array.
19713 : * """
19714 : */
19715 :
19716 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19717 : npy_intp __pyx_r;
19718 :
19719 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
19720 : * """Returns the total size (in number of elements) of the array.
19721 : * """
19722 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19723 : *
19724 : * @property
19725 : */
19726 : __pyx_r = PyArray_SIZE(__pyx_v_self);
19727 : goto __pyx_L0;
19728 :
19729 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19730 : *
19731 : * @property
19732 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19733 : * """Returns the total size (in number of elements) of the array.
19734 : * """
19735 : */
19736 :
19737 : /* function exit code */
19738 : __pyx_L0:;
19739 : return __pyx_r;
19740 : }
19741 :
19742 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19743 : *
19744 : * @property
19745 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19746 : * """The pointer to the data buffer as a char*.
19747 : * This is provided for legacy reasons to avoid direct struct field access.
19748 : */
19749 :
19750 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19751 : char *__pyx_r;
19752 :
19753 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
19754 : * of `PyArray_DATA()` instead, which returns a 'void*'.
19755 : * """
19756 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19757 : *
19758 : *
19759 : */
19760 : __pyx_r = PyArray_BYTES(__pyx_v_self);
19761 : goto __pyx_L0;
19762 :
19763 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19764 : *
19765 : * @property
19766 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19767 : * """The pointer to the data buffer as a char*.
19768 : * This is provided for legacy reasons to avoid direct struct field access.
19769 : */
19770 :
19771 : /* function exit code */
19772 : __pyx_L0:;
19773 : return __pyx_r;
19774 : }
19775 :
19776 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19777 : * ctypedef long double complex clongdouble_t
19778 : *
19779 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19780 : * return PyArray_MultiIterNew(1, <void*>a)
19781 : *
19782 : */
19783 :
19784 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19785 : PyObject *__pyx_r = NULL;
19786 : __Pyx_RefNannyDeclarations
19787 : PyObject *__pyx_t_1 = NULL;
19788 : int __pyx_lineno = 0;
19789 : const char *__pyx_filename = NULL;
19790 : int __pyx_clineno = 0;
19791 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19792 :
19793 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
19794 : *
19795 : * cdef inline object PyArray_MultiIterNew1(a):
19796 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19797 : *
19798 : * cdef inline object PyArray_MultiIterNew2(a, b):
19799 : */
19800 : __Pyx_XDECREF(__pyx_r);
19801 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19802 : __Pyx_GOTREF(__pyx_t_1);
19803 : __pyx_r = __pyx_t_1;
19804 : __pyx_t_1 = 0;
19805 : goto __pyx_L0;
19806 :
19807 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19808 : * ctypedef long double complex clongdouble_t
19809 : *
19810 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19811 : * return PyArray_MultiIterNew(1, <void*>a)
19812 : *
19813 : */
19814 :
19815 : /* function exit code */
19816 : __pyx_L1_error:;
19817 : __Pyx_XDECREF(__pyx_t_1);
19818 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19819 : __pyx_r = 0;
19820 : __pyx_L0:;
19821 : __Pyx_XGIVEREF(__pyx_r);
19822 : __Pyx_RefNannyFinishContext();
19823 : return __pyx_r;
19824 : }
19825 :
19826 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19827 : * return PyArray_MultiIterNew(1, <void*>a)
19828 : *
19829 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19830 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19831 : *
19832 : */
19833 :
19834 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19835 : PyObject *__pyx_r = NULL;
19836 : __Pyx_RefNannyDeclarations
19837 : PyObject *__pyx_t_1 = NULL;
19838 : int __pyx_lineno = 0;
19839 : const char *__pyx_filename = NULL;
19840 : int __pyx_clineno = 0;
19841 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19842 :
19843 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
19844 : *
19845 : * cdef inline object PyArray_MultiIterNew2(a, b):
19846 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19847 : *
19848 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19849 : */
19850 : __Pyx_XDECREF(__pyx_r);
19851 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
19852 : __Pyx_GOTREF(__pyx_t_1);
19853 : __pyx_r = __pyx_t_1;
19854 : __pyx_t_1 = 0;
19855 : goto __pyx_L0;
19856 :
19857 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19858 : * return PyArray_MultiIterNew(1, <void*>a)
19859 : *
19860 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19861 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19862 : *
19863 : */
19864 :
19865 : /* function exit code */
19866 : __pyx_L1_error:;
19867 : __Pyx_XDECREF(__pyx_t_1);
19868 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19869 : __pyx_r = 0;
19870 : __pyx_L0:;
19871 : __Pyx_XGIVEREF(__pyx_r);
19872 : __Pyx_RefNannyFinishContext();
19873 : return __pyx_r;
19874 : }
19875 :
19876 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19877 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19878 : *
19879 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19880 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19881 : *
19882 : */
19883 :
19884 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19885 : PyObject *__pyx_r = NULL;
19886 : __Pyx_RefNannyDeclarations
19887 : PyObject *__pyx_t_1 = NULL;
19888 : int __pyx_lineno = 0;
19889 : const char *__pyx_filename = NULL;
19890 : int __pyx_clineno = 0;
19891 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19892 :
19893 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
19894 : *
19895 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19896 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19897 : *
19898 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19899 : */
19900 : __Pyx_XDECREF(__pyx_r);
19901 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
19902 : __Pyx_GOTREF(__pyx_t_1);
19903 : __pyx_r = __pyx_t_1;
19904 : __pyx_t_1 = 0;
19905 : goto __pyx_L0;
19906 :
19907 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19908 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19909 : *
19910 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19911 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19912 : *
19913 : */
19914 :
19915 : /* function exit code */
19916 : __pyx_L1_error:;
19917 : __Pyx_XDECREF(__pyx_t_1);
19918 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19919 : __pyx_r = 0;
19920 : __pyx_L0:;
19921 : __Pyx_XGIVEREF(__pyx_r);
19922 : __Pyx_RefNannyFinishContext();
19923 : return __pyx_r;
19924 : }
19925 :
19926 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19927 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19928 : *
19929 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19930 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19931 : *
19932 : */
19933 :
19934 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19935 : PyObject *__pyx_r = NULL;
19936 : __Pyx_RefNannyDeclarations
19937 : PyObject *__pyx_t_1 = NULL;
19938 : int __pyx_lineno = 0;
19939 : const char *__pyx_filename = NULL;
19940 : int __pyx_clineno = 0;
19941 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19942 :
19943 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
19944 : *
19945 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19946 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19947 : *
19948 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19949 : */
19950 : __Pyx_XDECREF(__pyx_r);
19951 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
19952 : __Pyx_GOTREF(__pyx_t_1);
19953 : __pyx_r = __pyx_t_1;
19954 : __pyx_t_1 = 0;
19955 : goto __pyx_L0;
19956 :
19957 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19958 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19959 : *
19960 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19961 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19962 : *
19963 : */
19964 :
19965 : /* function exit code */
19966 : __pyx_L1_error:;
19967 : __Pyx_XDECREF(__pyx_t_1);
19968 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19969 : __pyx_r = 0;
19970 : __pyx_L0:;
19971 : __Pyx_XGIVEREF(__pyx_r);
19972 : __Pyx_RefNannyFinishContext();
19973 : return __pyx_r;
19974 : }
19975 :
19976 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19977 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19978 : *
19979 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19980 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19981 : *
19982 : */
19983 :
19984 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19985 : PyObject *__pyx_r = NULL;
19986 : __Pyx_RefNannyDeclarations
19987 : PyObject *__pyx_t_1 = NULL;
19988 : int __pyx_lineno = 0;
19989 : const char *__pyx_filename = NULL;
19990 : int __pyx_clineno = 0;
19991 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19992 :
19993 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
19994 : *
19995 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19996 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19997 : *
19998 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19999 : */
20000 : __Pyx_XDECREF(__pyx_r);
20001 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
20002 : __Pyx_GOTREF(__pyx_t_1);
20003 : __pyx_r = __pyx_t_1;
20004 : __pyx_t_1 = 0;
20005 : goto __pyx_L0;
20006 :
20007 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
20008 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20009 : *
20010 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20011 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20012 : *
20013 : */
20014 :
20015 : /* function exit code */
20016 : __pyx_L1_error:;
20017 : __Pyx_XDECREF(__pyx_t_1);
20018 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20019 : __pyx_r = 0;
20020 : __pyx_L0:;
20021 : __Pyx_XGIVEREF(__pyx_r);
20022 : __Pyx_RefNannyFinishContext();
20023 : return __pyx_r;
20024 : }
20025 :
20026 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
20027 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20028 : *
20029 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20030 : * if PyDataType_HASSUBARRAY(d):
20031 : * return <tuple>d.subarray.shape
20032 : */
20033 :
20034 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20035 : PyObject *__pyx_r = NULL;
20036 : __Pyx_RefNannyDeclarations
20037 : int __pyx_t_1;
20038 : PyObject *__pyx_t_2;
20039 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
20040 :
20041 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
20042 : *
20043 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20044 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20045 : * return <tuple>d.subarray.shape
20046 : * else:
20047 : */
20048 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20049 : if (__pyx_t_1) {
20050 :
20051 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
20052 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20053 : * if PyDataType_HASSUBARRAY(d):
20054 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20055 : * else:
20056 : * return ()
20057 : */
20058 : __Pyx_XDECREF(__pyx_r);
20059 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
20060 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
20061 : __pyx_r = ((PyObject*)__pyx_t_2);
20062 : goto __pyx_L0;
20063 :
20064 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
20065 : *
20066 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20067 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20068 : * return <tuple>d.subarray.shape
20069 : * else:
20070 : */
20071 : }
20072 :
20073 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
20074 : * return <tuple>d.subarray.shape
20075 : * else:
20076 : * return () # <<<<<<<<<<<<<<
20077 : *
20078 : *
20079 : */
20080 : /*else*/ {
20081 : __Pyx_XDECREF(__pyx_r);
20082 : __Pyx_INCREF(__pyx_empty_tuple);
20083 : __pyx_r = __pyx_empty_tuple;
20084 : goto __pyx_L0;
20085 : }
20086 :
20087 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
20088 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20089 : *
20090 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20091 : * if PyDataType_HASSUBARRAY(d):
20092 : * return <tuple>d.subarray.shape
20093 : */
20094 :
20095 : /* function exit code */
20096 : __pyx_L0:;
20097 : __Pyx_XGIVEREF(__pyx_r);
20098 : __Pyx_RefNannyFinishContext();
20099 : return __pyx_r;
20100 : }
20101 :
20102 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
20103 : * int _import_umath() except -1
20104 : *
20105 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20106 : * Py_INCREF(base) # important to do this before stealing the reference below!
20107 : * PyArray_SetBaseObject(arr, base)
20108 : */
20109 :
20110 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20111 : int __pyx_t_1;
20112 : int __pyx_lineno = 0;
20113 : const char *__pyx_filename = NULL;
20114 : int __pyx_clineno = 0;
20115 :
20116 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
20117 : *
20118 : * cdef inline void set_array_base(ndarray arr, object base) except *:
20119 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20120 : * PyArray_SetBaseObject(arr, base)
20121 : *
20122 : */
20123 : Py_INCREF(__pyx_v_base);
20124 :
20125 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
20126 : * cdef inline void set_array_base(ndarray arr, object base) except *:
20127 : * Py_INCREF(base) # important to do this before stealing the reference below!
20128 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20129 : *
20130 : * cdef inline object get_array_base(ndarray arr):
20131 : */
20132 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
20133 :
20134 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
20135 : * int _import_umath() except -1
20136 : *
20137 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20138 : * Py_INCREF(base) # important to do this before stealing the reference below!
20139 : * PyArray_SetBaseObject(arr, base)
20140 : */
20141 :
20142 : /* function exit code */
20143 : goto __pyx_L0;
20144 : __pyx_L1_error:;
20145 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20146 : __pyx_L0:;
20147 : }
20148 :
20149 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
20150 : * PyArray_SetBaseObject(arr, base)
20151 : *
20152 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20153 : * base = PyArray_BASE(arr)
20154 : * if base is NULL:
20155 : */
20156 :
20157 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20158 : PyObject *__pyx_v_base;
20159 : PyObject *__pyx_r = NULL;
20160 : __Pyx_RefNannyDeclarations
20161 : int __pyx_t_1;
20162 : __Pyx_RefNannySetupContext("get_array_base", 1);
20163 :
20164 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
20165 : *
20166 : * cdef inline object get_array_base(ndarray arr):
20167 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20168 : * if base is NULL:
20169 : * return None
20170 : */
20171 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20172 :
20173 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
20174 : * cdef inline object get_array_base(ndarray arr):
20175 : * base = PyArray_BASE(arr)
20176 : * if base is NULL: # <<<<<<<<<<<<<<
20177 : * return None
20178 : * return <object>base
20179 : */
20180 : __pyx_t_1 = (__pyx_v_base == NULL);
20181 : if (__pyx_t_1) {
20182 :
20183 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
20184 : * base = PyArray_BASE(arr)
20185 : * if base is NULL:
20186 : * return None # <<<<<<<<<<<<<<
20187 : * return <object>base
20188 : *
20189 : */
20190 : __Pyx_XDECREF(__pyx_r);
20191 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20192 : goto __pyx_L0;
20193 :
20194 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
20195 : * cdef inline object get_array_base(ndarray arr):
20196 : * base = PyArray_BASE(arr)
20197 : * if base is NULL: # <<<<<<<<<<<<<<
20198 : * return None
20199 : * return <object>base
20200 : */
20201 : }
20202 :
20203 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
20204 : * if base is NULL:
20205 : * return None
20206 : * return <object>base # <<<<<<<<<<<<<<
20207 : *
20208 : * # Versions of the import_* functions which are more suitable for
20209 : */
20210 : __Pyx_XDECREF(__pyx_r);
20211 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
20212 : __pyx_r = ((PyObject *)__pyx_v_base);
20213 : goto __pyx_L0;
20214 :
20215 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
20216 : * PyArray_SetBaseObject(arr, base)
20217 : *
20218 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20219 : * base = PyArray_BASE(arr)
20220 : * if base is NULL:
20221 : */
20222 :
20223 : /* function exit code */
20224 : __pyx_L0:;
20225 : __Pyx_XGIVEREF(__pyx_r);
20226 : __Pyx_RefNannyFinishContext();
20227 : return __pyx_r;
20228 : }
20229 :
20230 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
20231 : * # Versions of the import_* functions which are more suitable for
20232 : * # Cython code.
20233 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20234 : * try:
20235 : * __pyx_import_array()
20236 : */
20237 :
20238 1 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20239 1 : int __pyx_r;
20240 : __Pyx_RefNannyDeclarations
20241 1 : PyObject *__pyx_t_1 = NULL;
20242 1 : PyObject *__pyx_t_2 = NULL;
20243 1 : PyObject *__pyx_t_3 = NULL;
20244 1 : int __pyx_t_4;
20245 1 : PyObject *__pyx_t_5 = NULL;
20246 1 : PyObject *__pyx_t_6 = NULL;
20247 1 : PyObject *__pyx_t_7 = NULL;
20248 1 : PyObject *__pyx_t_8 = NULL;
20249 1 : int __pyx_lineno = 0;
20250 1 : const char *__pyx_filename = NULL;
20251 1 : int __pyx_clineno = 0;
20252 1 : __Pyx_RefNannySetupContext("import_array", 1);
20253 :
20254 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20255 : * # Cython code.
20256 : * cdef inline int import_array() except -1:
20257 : * try: # <<<<<<<<<<<<<<
20258 : * __pyx_import_array()
20259 : * except Exception:
20260 : */
20261 1 : {
20262 1 : __Pyx_PyThreadState_declare
20263 1 : __Pyx_PyThreadState_assign
20264 1 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20265 1 : __Pyx_XGOTREF(__pyx_t_1);
20266 1 : __Pyx_XGOTREF(__pyx_t_2);
20267 1 : __Pyx_XGOTREF(__pyx_t_3);
20268 1 : /*try:*/ {
20269 :
20270 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
20271 : * cdef inline int import_array() except -1:
20272 : * try:
20273 : * __pyx_import_array() # <<<<<<<<<<<<<<
20274 : * except Exception:
20275 : * raise ImportError("numpy._core.multiarray failed to import")
20276 : */
20277 1 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
20278 :
20279 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20280 : * # Cython code.
20281 : * cdef inline int import_array() except -1:
20282 : * try: # <<<<<<<<<<<<<<
20283 : * __pyx_import_array()
20284 : * except Exception:
20285 : */
20286 : }
20287 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20288 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20289 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20290 1 : goto __pyx_L8_try_end;
20291 0 : __pyx_L3_error:;
20292 :
20293 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
20294 : * try:
20295 : * __pyx_import_array()
20296 : * except Exception: # <<<<<<<<<<<<<<
20297 : * raise ImportError("numpy._core.multiarray failed to import")
20298 : *
20299 : */
20300 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20301 0 : if (__pyx_t_4) {
20302 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20303 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
20304 0 : __Pyx_XGOTREF(__pyx_t_5);
20305 0 : __Pyx_XGOTREF(__pyx_t_6);
20306 0 : __Pyx_XGOTREF(__pyx_t_7);
20307 :
20308 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
20309 : * __pyx_import_array()
20310 : * except Exception:
20311 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
20312 : *
20313 : * cdef inline int import_umath() except -1:
20314 : */
20315 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
20316 0 : __Pyx_GOTREF(__pyx_t_8);
20317 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20318 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20319 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
20320 : }
20321 0 : goto __pyx_L5_except_error;
20322 :
20323 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20324 : * # Cython code.
20325 : * cdef inline int import_array() except -1:
20326 : * try: # <<<<<<<<<<<<<<
20327 : * __pyx_import_array()
20328 : * except Exception:
20329 : */
20330 0 : __pyx_L5_except_error:;
20331 0 : __Pyx_XGIVEREF(__pyx_t_1);
20332 0 : __Pyx_XGIVEREF(__pyx_t_2);
20333 0 : __Pyx_XGIVEREF(__pyx_t_3);
20334 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20335 0 : goto __pyx_L1_error;
20336 1 : __pyx_L8_try_end:;
20337 : }
20338 :
20339 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
20340 : * # Versions of the import_* functions which are more suitable for
20341 : * # Cython code.
20342 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20343 : * try:
20344 : * __pyx_import_array()
20345 : */
20346 :
20347 : /* function exit code */
20348 1 : __pyx_r = 0;
20349 1 : goto __pyx_L0;
20350 0 : __pyx_L1_error:;
20351 0 : __Pyx_XDECREF(__pyx_t_5);
20352 0 : __Pyx_XDECREF(__pyx_t_6);
20353 0 : __Pyx_XDECREF(__pyx_t_7);
20354 0 : __Pyx_XDECREF(__pyx_t_8);
20355 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20356 : __pyx_r = -1;
20357 1 : __pyx_L0:;
20358 1 : __Pyx_RefNannyFinishContext();
20359 1 : return __pyx_r;
20360 : }
20361 :
20362 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
20363 : * raise ImportError("numpy._core.multiarray failed to import")
20364 : *
20365 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20366 : * try:
20367 : * _import_umath()
20368 : */
20369 :
20370 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20371 : int __pyx_r;
20372 : __Pyx_RefNannyDeclarations
20373 : PyObject *__pyx_t_1 = NULL;
20374 : PyObject *__pyx_t_2 = NULL;
20375 : PyObject *__pyx_t_3 = NULL;
20376 : int __pyx_t_4;
20377 : PyObject *__pyx_t_5 = NULL;
20378 : PyObject *__pyx_t_6 = NULL;
20379 : PyObject *__pyx_t_7 = NULL;
20380 : PyObject *__pyx_t_8 = NULL;
20381 : int __pyx_lineno = 0;
20382 : const char *__pyx_filename = NULL;
20383 : int __pyx_clineno = 0;
20384 : __Pyx_RefNannySetupContext("import_umath", 1);
20385 :
20386 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
20387 : *
20388 : * cdef inline int import_umath() except -1:
20389 : * try: # <<<<<<<<<<<<<<
20390 : * _import_umath()
20391 : * except Exception:
20392 : */
20393 : {
20394 : __Pyx_PyThreadState_declare
20395 : __Pyx_PyThreadState_assign
20396 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20397 : __Pyx_XGOTREF(__pyx_t_1);
20398 : __Pyx_XGOTREF(__pyx_t_2);
20399 : __Pyx_XGOTREF(__pyx_t_3);
20400 : /*try:*/ {
20401 :
20402 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
20403 : * cdef inline int import_umath() except -1:
20404 : * try:
20405 : * _import_umath() # <<<<<<<<<<<<<<
20406 : * except Exception:
20407 : * raise ImportError("numpy._core.umath failed to import")
20408 : */
20409 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
20410 :
20411 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
20412 : *
20413 : * cdef inline int import_umath() except -1:
20414 : * try: # <<<<<<<<<<<<<<
20415 : * _import_umath()
20416 : * except Exception:
20417 : */
20418 : }
20419 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20420 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20421 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20422 : goto __pyx_L8_try_end;
20423 : __pyx_L3_error:;
20424 :
20425 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
20426 : * try:
20427 : * _import_umath()
20428 : * except Exception: # <<<<<<<<<<<<<<
20429 : * raise ImportError("numpy._core.umath failed to import")
20430 : *
20431 : */
20432 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20433 : if (__pyx_t_4) {
20434 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20435 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
20436 : __Pyx_XGOTREF(__pyx_t_5);
20437 : __Pyx_XGOTREF(__pyx_t_6);
20438 : __Pyx_XGOTREF(__pyx_t_7);
20439 :
20440 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
20441 : * _import_umath()
20442 : * except Exception:
20443 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20444 : *
20445 : * cdef inline int import_ufunc() except -1:
20446 : */
20447 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
20448 : __Pyx_GOTREF(__pyx_t_8);
20449 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20450 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20451 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
20452 : }
20453 : goto __pyx_L5_except_error;
20454 :
20455 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
20456 : *
20457 : * cdef inline int import_umath() except -1:
20458 : * try: # <<<<<<<<<<<<<<
20459 : * _import_umath()
20460 : * except Exception:
20461 : */
20462 : __pyx_L5_except_error:;
20463 : __Pyx_XGIVEREF(__pyx_t_1);
20464 : __Pyx_XGIVEREF(__pyx_t_2);
20465 : __Pyx_XGIVEREF(__pyx_t_3);
20466 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20467 : goto __pyx_L1_error;
20468 : __pyx_L8_try_end:;
20469 : }
20470 :
20471 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
20472 : * raise ImportError("numpy._core.multiarray failed to import")
20473 : *
20474 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20475 : * try:
20476 : * _import_umath()
20477 : */
20478 :
20479 : /* function exit code */
20480 : __pyx_r = 0;
20481 : goto __pyx_L0;
20482 : __pyx_L1_error:;
20483 : __Pyx_XDECREF(__pyx_t_5);
20484 : __Pyx_XDECREF(__pyx_t_6);
20485 : __Pyx_XDECREF(__pyx_t_7);
20486 : __Pyx_XDECREF(__pyx_t_8);
20487 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20488 : __pyx_r = -1;
20489 : __pyx_L0:;
20490 : __Pyx_RefNannyFinishContext();
20491 : return __pyx_r;
20492 : }
20493 :
20494 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
20495 : * raise ImportError("numpy._core.umath failed to import")
20496 : *
20497 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20498 : * try:
20499 : * _import_umath()
20500 : */
20501 :
20502 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20503 : int __pyx_r;
20504 : __Pyx_RefNannyDeclarations
20505 : PyObject *__pyx_t_1 = NULL;
20506 : PyObject *__pyx_t_2 = NULL;
20507 : PyObject *__pyx_t_3 = NULL;
20508 : int __pyx_t_4;
20509 : PyObject *__pyx_t_5 = NULL;
20510 : PyObject *__pyx_t_6 = NULL;
20511 : PyObject *__pyx_t_7 = NULL;
20512 : PyObject *__pyx_t_8 = NULL;
20513 : int __pyx_lineno = 0;
20514 : const char *__pyx_filename = NULL;
20515 : int __pyx_clineno = 0;
20516 : __Pyx_RefNannySetupContext("import_ufunc", 1);
20517 :
20518 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20519 : *
20520 : * cdef inline int import_ufunc() except -1:
20521 : * try: # <<<<<<<<<<<<<<
20522 : * _import_umath()
20523 : * except Exception:
20524 : */
20525 : {
20526 : __Pyx_PyThreadState_declare
20527 : __Pyx_PyThreadState_assign
20528 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20529 : __Pyx_XGOTREF(__pyx_t_1);
20530 : __Pyx_XGOTREF(__pyx_t_2);
20531 : __Pyx_XGOTREF(__pyx_t_3);
20532 : /*try:*/ {
20533 :
20534 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
20535 : * cdef inline int import_ufunc() except -1:
20536 : * try:
20537 : * _import_umath() # <<<<<<<<<<<<<<
20538 : * except Exception:
20539 : * raise ImportError("numpy._core.umath failed to import")
20540 : */
20541 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
20542 :
20543 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20544 : *
20545 : * cdef inline int import_ufunc() except -1:
20546 : * try: # <<<<<<<<<<<<<<
20547 : * _import_umath()
20548 : * except Exception:
20549 : */
20550 : }
20551 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20552 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20553 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20554 : goto __pyx_L8_try_end;
20555 : __pyx_L3_error:;
20556 :
20557 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
20558 : * try:
20559 : * _import_umath()
20560 : * except Exception: # <<<<<<<<<<<<<<
20561 : * raise ImportError("numpy._core.umath failed to import")
20562 : *
20563 : */
20564 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20565 : if (__pyx_t_4) {
20566 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20567 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
20568 : __Pyx_XGOTREF(__pyx_t_5);
20569 : __Pyx_XGOTREF(__pyx_t_6);
20570 : __Pyx_XGOTREF(__pyx_t_7);
20571 :
20572 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
20573 : * _import_umath()
20574 : * except Exception:
20575 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20576 : *
20577 : *
20578 : */
20579 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
20580 : __Pyx_GOTREF(__pyx_t_8);
20581 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20582 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20583 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
20584 : }
20585 : goto __pyx_L5_except_error;
20586 :
20587 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20588 : *
20589 : * cdef inline int import_ufunc() except -1:
20590 : * try: # <<<<<<<<<<<<<<
20591 : * _import_umath()
20592 : * except Exception:
20593 : */
20594 : __pyx_L5_except_error:;
20595 : __Pyx_XGIVEREF(__pyx_t_1);
20596 : __Pyx_XGIVEREF(__pyx_t_2);
20597 : __Pyx_XGIVEREF(__pyx_t_3);
20598 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20599 : goto __pyx_L1_error;
20600 : __pyx_L8_try_end:;
20601 : }
20602 :
20603 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
20604 : * raise ImportError("numpy._core.umath failed to import")
20605 : *
20606 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20607 : * try:
20608 : * _import_umath()
20609 : */
20610 :
20611 : /* function exit code */
20612 : __pyx_r = 0;
20613 : goto __pyx_L0;
20614 : __pyx_L1_error:;
20615 : __Pyx_XDECREF(__pyx_t_5);
20616 : __Pyx_XDECREF(__pyx_t_6);
20617 : __Pyx_XDECREF(__pyx_t_7);
20618 : __Pyx_XDECREF(__pyx_t_8);
20619 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20620 : __pyx_r = -1;
20621 : __pyx_L0:;
20622 : __Pyx_RefNannyFinishContext();
20623 : return __pyx_r;
20624 : }
20625 :
20626 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20627 : *
20628 : *
20629 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20630 : * """
20631 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20632 : */
20633 :
20634 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20635 : int __pyx_r;
20636 :
20637 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
20638 : * bool
20639 : * """
20640 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
20641 : *
20642 : *
20643 : */
20644 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20645 : goto __pyx_L0;
20646 :
20647 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20648 : *
20649 : *
20650 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20651 : * """
20652 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20653 : */
20654 :
20655 : /* function exit code */
20656 : __pyx_L0:;
20657 : return __pyx_r;
20658 : }
20659 :
20660 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20661 : *
20662 : *
20663 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20664 : * """
20665 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20666 : */
20667 :
20668 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20669 : int __pyx_r;
20670 :
20671 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
20672 : * bool
20673 : * """
20674 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
20675 : *
20676 : *
20677 : */
20678 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20679 : goto __pyx_L0;
20680 :
20681 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20682 : *
20683 : *
20684 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20685 : * """
20686 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20687 : */
20688 :
20689 : /* function exit code */
20690 : __pyx_L0:;
20691 : return __pyx_r;
20692 : }
20693 :
20694 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20695 : *
20696 : *
20697 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20698 : * """
20699 : * returns the int64 value underlying scalar numpy datetime64 object
20700 : */
20701 :
20702 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20703 : npy_datetime __pyx_r;
20704 :
20705 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
20706 : * also needed. That can be found using `get_datetime64_unit`.
20707 : * """
20708 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
20709 : *
20710 : *
20711 : */
20712 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20713 : goto __pyx_L0;
20714 :
20715 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20716 : *
20717 : *
20718 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20719 : * """
20720 : * returns the int64 value underlying scalar numpy datetime64 object
20721 : */
20722 :
20723 : /* function exit code */
20724 : __pyx_L0:;
20725 : return __pyx_r;
20726 : }
20727 :
20728 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20729 : *
20730 : *
20731 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20732 : * """
20733 : * returns the int64 value underlying scalar numpy timedelta64 object
20734 : */
20735 :
20736 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20737 : npy_timedelta __pyx_r;
20738 :
20739 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
20740 : * returns the int64 value underlying scalar numpy timedelta64 object
20741 : * """
20742 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
20743 : *
20744 : *
20745 : */
20746 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20747 : goto __pyx_L0;
20748 :
20749 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20750 : *
20751 : *
20752 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20753 : * """
20754 : * returns the int64 value underlying scalar numpy timedelta64 object
20755 : */
20756 :
20757 : /* function exit code */
20758 : __pyx_L0:;
20759 : return __pyx_r;
20760 : }
20761 :
20762 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20763 : *
20764 : *
20765 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20766 : * """
20767 : * returns the unit part of the dtype for a numpy datetime64 object.
20768 : */
20769 :
20770 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20771 : NPY_DATETIMEUNIT __pyx_r;
20772 :
20773 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
20774 : * returns the unit part of the dtype for a numpy datetime64 object.
20775 : * """
20776 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
20777 : *
20778 : *
20779 : */
20780 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20781 : goto __pyx_L0;
20782 :
20783 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20784 : *
20785 : *
20786 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20787 : * """
20788 : * returns the unit part of the dtype for a numpy datetime64 object.
20789 : */
20790 :
20791 : /* function exit code */
20792 : __pyx_L0:;
20793 : return __pyx_r;
20794 : }
20795 :
20796 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":70
20797 : *
20798 : *
20799 : * cdef str _opt_warning(string name, val, valid_set=None): # <<<<<<<<<<<<<<
20800 : * cdef OptionRecord * r = _ref_opt_lookup[name]
20801 : *
20802 : */
20803 :
20804 18 : static PyObject *__pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(std::string __pyx_v_name, PyObject *__pyx_v_val, struct __pyx_opt_args_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning *__pyx_optional_args) {
20805 18 : PyObject *__pyx_v_valid_set = ((PyObject *)Py_None);
20806 18 : OptionRecord *__pyx_v_r;
20807 18 : PyObject *__pyx_v_default_value = NULL;
20808 18 : PyObject *__pyx_v_lower_bound = NULL;
20809 18 : PyObject *__pyx_v_upper_bound = NULL;
20810 18 : PyObject *__pyx_v_int_range = NULL;
20811 18 : PyObject *__pyx_v_descr = NULL;
20812 18 : PyObject *__pyx_r = NULL;
20813 : __Pyx_RefNannyDeclarations
20814 18 : int __pyx_t_1;
20815 18 : PyObject *__pyx_t_2 = NULL;
20816 18 : Py_ssize_t __pyx_t_3;
20817 18 : Py_UCS4 __pyx_t_4;
20818 18 : PyObject *__pyx_t_5 = NULL;
20819 18 : PyObject *__pyx_t_6 = NULL;
20820 18 : int __pyx_lineno = 0;
20821 18 : const char *__pyx_filename = NULL;
20822 18 : int __pyx_clineno = 0;
20823 18 : __Pyx_RefNannySetupContext("_opt_warning", 1);
20824 18 : if (__pyx_optional_args) {
20825 2 : if (__pyx_optional_args->__pyx_n > 0) {
20826 2 : __pyx_v_valid_set = __pyx_optional_args->valid_set;
20827 : }
20828 : }
20829 :
20830 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":71
20831 : *
20832 : * cdef str _opt_warning(string name, val, valid_set=None):
20833 : * cdef OptionRecord * r = _ref_opt_lookup[name] # <<<<<<<<<<<<<<
20834 : *
20835 : * # BOOL
20836 : */
20837 18 : __pyx_v_r = (__pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__ref_opt_lookup[__pyx_v_name]);
20838 :
20839 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":74
20840 : *
20841 : * # BOOL
20842 : * if r.type == HighsOptionTypeBOOL: # <<<<<<<<<<<<<<
20843 : * default_value = (<OptionRecordBool*> r).default_value
20844 : * return ('Option "%s" is "%s", but only True or False is allowed. '
20845 : */
20846 18 : __pyx_t_1 = (__pyx_v_r->type == HighsOptionType::kBool);
20847 18 : if (__pyx_t_1) {
20848 :
20849 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":75
20850 : * # BOOL
20851 : * if r.type == HighsOptionTypeBOOL:
20852 : * default_value = (<OptionRecordBool*> r).default_value # <<<<<<<<<<<<<<
20853 : * return ('Option "%s" is "%s", but only True or False is allowed. '
20854 : * 'Using default: %s.' % (name.decode(), str(val), default_value))
20855 : */
20856 4 : __pyx_t_2 = __Pyx_PyBool_FromLong(((OptionRecordBool *)__pyx_v_r)->default_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
20857 4 : __Pyx_GOTREF(__pyx_t_2);
20858 4 : __pyx_v_default_value = __pyx_t_2;
20859 4 : __pyx_t_2 = 0;
20860 :
20861 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":76
20862 : * if r.type == HighsOptionTypeBOOL:
20863 : * default_value = (<OptionRecordBool*> r).default_value
20864 : * return ('Option "%s" is "%s", but only True or False is allowed. ' # <<<<<<<<<<<<<<
20865 : * 'Using default: %s.' % (name.decode(), str(val), default_value))
20866 : *
20867 : */
20868 4 : __Pyx_XDECREF(__pyx_r);
20869 4 : __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
20870 4 : __Pyx_GOTREF(__pyx_t_2);
20871 4 : __pyx_t_3 = 0;
20872 4 : __pyx_t_4 = 127;
20873 4 : __Pyx_INCREF(__pyx_kp_u_Option);
20874 4 : __pyx_t_3 += 8;
20875 4 : __Pyx_GIVEREF(__pyx_kp_u_Option);
20876 4 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Option);
20877 :
20878 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":77
20879 : * default_value = (<OptionRecordBool*> r).default_value
20880 : * return ('Option "%s" is "%s", but only True or False is allowed. '
20881 : * 'Using default: %s.' % (name.decode(), str(val), default_value)) # <<<<<<<<<<<<<<
20882 : *
20883 : * # INT
20884 : */
20885 8 : __pyx_t_5 = __Pyx_decode_cpp_string(__pyx_v_name, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
20886 4 : __Pyx_GOTREF(__pyx_t_5);
20887 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
20888 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
20889 4 : __Pyx_GIVEREF(__pyx_t_5);
20890 4 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
20891 4 : __pyx_t_5 = 0;
20892 4 : __Pyx_INCREF(__pyx_kp_u_is);
20893 4 : __pyx_t_3 += 6;
20894 4 : __Pyx_GIVEREF(__pyx_kp_u_is);
20895 4 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is);
20896 4 : __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
20897 4 : __Pyx_GOTREF(__pyx_t_5);
20898 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
20899 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
20900 4 : __Pyx_GIVEREF(__pyx_t_5);
20901 4 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
20902 4 : __pyx_t_5 = 0;
20903 4 : __Pyx_INCREF(__pyx_kp_u_but_only_True_or_False_is_allow);
20904 4 : __pyx_t_3 += 53;
20905 4 : __Pyx_GIVEREF(__pyx_kp_u_but_only_True_or_False_is_allow);
20906 4 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_but_only_True_or_False_is_allow);
20907 4 : __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_default_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
20908 4 : __Pyx_GOTREF(__pyx_t_5);
20909 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
20910 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
20911 4 : __Pyx_GIVEREF(__pyx_t_5);
20912 4 : PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5);
20913 4 : __pyx_t_5 = 0;
20914 4 : __Pyx_INCREF(__pyx_kp_u__2);
20915 4 : __pyx_t_3 += 1;
20916 4 : __Pyx_GIVEREF(__pyx_kp_u__2);
20917 4 : PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__2);
20918 :
20919 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":76
20920 : * if r.type == HighsOptionTypeBOOL:
20921 : * default_value = (<OptionRecordBool*> r).default_value
20922 : * return ('Option "%s" is "%s", but only True or False is allowed. ' # <<<<<<<<<<<<<<
20923 : * 'Using default: %s.' % (name.decode(), str(val), default_value))
20924 : *
20925 : */
20926 4 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
20927 4 : __Pyx_GOTREF(__pyx_t_5);
20928 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20929 4 : __pyx_r = ((PyObject*)__pyx_t_5);
20930 4 : __pyx_t_5 = 0;
20931 4 : goto __pyx_L0;
20932 :
20933 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":74
20934 : *
20935 : * # BOOL
20936 : * if r.type == HighsOptionTypeBOOL: # <<<<<<<<<<<<<<
20937 : * default_value = (<OptionRecordBool*> r).default_value
20938 : * return ('Option "%s" is "%s", but only True or False is allowed. '
20939 : */
20940 : }
20941 :
20942 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":80
20943 : *
20944 : * # INT
20945 : * if r.type == HighsOptionTypeINT: # <<<<<<<<<<<<<<
20946 : * lower_bound = int((<OptionRecordInt*> r).lower_bound)
20947 : * upper_bound = int((<OptionRecordInt*> r).upper_bound)
20948 : */
20949 14 : __pyx_t_1 = (__pyx_v_r->type == HighsOptionType::kInt);
20950 14 : if (__pyx_t_1) {
20951 :
20952 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":81
20953 : * # INT
20954 : * if r.type == HighsOptionTypeINT:
20955 : * lower_bound = int((<OptionRecordInt*> r).lower_bound) # <<<<<<<<<<<<<<
20956 : * upper_bound = int((<OptionRecordInt*> r).upper_bound)
20957 : * default_value = int((<OptionRecordInt*> r).default_value)
20958 : */
20959 4 : __pyx_t_5 = __Pyx_PyInt_From_int(((OptionRecordInt *)__pyx_v_r)->lower_bound); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
20960 4 : __Pyx_GOTREF(__pyx_t_5);
20961 4 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
20962 4 : __Pyx_GOTREF(__pyx_t_2);
20963 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20964 4 : __pyx_v_lower_bound = __pyx_t_2;
20965 4 : __pyx_t_2 = 0;
20966 :
20967 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":82
20968 : * if r.type == HighsOptionTypeINT:
20969 : * lower_bound = int((<OptionRecordInt*> r).lower_bound)
20970 : * upper_bound = int((<OptionRecordInt*> r).upper_bound) # <<<<<<<<<<<<<<
20971 : * default_value = int((<OptionRecordInt*> r).default_value)
20972 : * if upper_bound - lower_bound < 10:
20973 : */
20974 4 : __pyx_t_2 = __Pyx_PyInt_From_int(((OptionRecordInt *)__pyx_v_r)->upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
20975 4 : __Pyx_GOTREF(__pyx_t_2);
20976 4 : __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
20977 4 : __Pyx_GOTREF(__pyx_t_5);
20978 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20979 4 : __pyx_v_upper_bound = __pyx_t_5;
20980 4 : __pyx_t_5 = 0;
20981 :
20982 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":83
20983 : * lower_bound = int((<OptionRecordInt*> r).lower_bound)
20984 : * upper_bound = int((<OptionRecordInt*> r).upper_bound)
20985 : * default_value = int((<OptionRecordInt*> r).default_value) # <<<<<<<<<<<<<<
20986 : * if upper_bound - lower_bound < 10:
20987 : * int_range = str(set(range(lower_bound, upper_bound + 1)))
20988 : */
20989 4 : __pyx_t_5 = __Pyx_PyInt_From_int(((OptionRecordInt *)__pyx_v_r)->default_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
20990 4 : __Pyx_GOTREF(__pyx_t_5);
20991 4 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
20992 4 : __Pyx_GOTREF(__pyx_t_2);
20993 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20994 4 : __pyx_v_default_value = __pyx_t_2;
20995 4 : __pyx_t_2 = 0;
20996 :
20997 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":84
20998 : * upper_bound = int((<OptionRecordInt*> r).upper_bound)
20999 : * default_value = int((<OptionRecordInt*> r).default_value)
21000 : * if upper_bound - lower_bound < 10: # <<<<<<<<<<<<<<
21001 : * int_range = str(set(range(lower_bound, upper_bound + 1)))
21002 : * else:
21003 : */
21004 4 : __pyx_t_2 = PyNumber_Subtract(__pyx_v_upper_bound, __pyx_v_lower_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
21005 4 : __Pyx_GOTREF(__pyx_t_2);
21006 4 : __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_10, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
21007 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21008 4 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 84, __pyx_L1_error)
21009 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21010 4 : if (__pyx_t_1) {
21011 :
21012 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":85
21013 : * default_value = int((<OptionRecordInt*> r).default_value)
21014 : * if upper_bound - lower_bound < 10:
21015 : * int_range = str(set(range(lower_bound, upper_bound + 1))) # <<<<<<<<<<<<<<
21016 : * else:
21017 : * int_range = '[%d, %d]' % (lower_bound, upper_bound)
21018 : */
21019 0 : __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_upper_bound, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
21020 0 : __Pyx_GOTREF(__pyx_t_5);
21021 0 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
21022 0 : __Pyx_GOTREF(__pyx_t_2);
21023 0 : __Pyx_INCREF(__pyx_v_lower_bound);
21024 0 : __Pyx_GIVEREF(__pyx_v_lower_bound);
21025 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_lower_bound)) __PYX_ERR(0, 85, __pyx_L1_error);
21026 0 : __Pyx_GIVEREF(__pyx_t_5);
21027 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error);
21028 0 : __pyx_t_5 = 0;
21029 0 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
21030 0 : __Pyx_GOTREF(__pyx_t_5);
21031 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21032 0 : __pyx_t_2 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
21033 0 : __Pyx_GOTREF(__pyx_t_2);
21034 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21035 0 : __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
21036 0 : __Pyx_GOTREF(__pyx_t_5);
21037 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21038 0 : __pyx_v_int_range = __pyx_t_5;
21039 0 : __pyx_t_5 = 0;
21040 :
21041 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":84
21042 : * upper_bound = int((<OptionRecordInt*> r).upper_bound)
21043 : * default_value = int((<OptionRecordInt*> r).default_value)
21044 : * if upper_bound - lower_bound < 10: # <<<<<<<<<<<<<<
21045 : * int_range = str(set(range(lower_bound, upper_bound + 1)))
21046 : * else:
21047 : */
21048 0 : goto __pyx_L5;
21049 : }
21050 :
21051 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":87
21052 : * int_range = str(set(range(lower_bound, upper_bound + 1)))
21053 : * else:
21054 : * int_range = '[%d, %d]' % (lower_bound, upper_bound) # <<<<<<<<<<<<<<
21055 : * return ('Option "%s" is "%s", but only values in %s are allowed. '
21056 : * 'Using default: %d.' % (name.decode(), str(val), int_range, default_value))
21057 : */
21058 4 : /*else*/ {
21059 4 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
21060 4 : __Pyx_GOTREF(__pyx_t_5);
21061 4 : __pyx_t_3 = 0;
21062 4 : __pyx_t_4 = 127;
21063 4 : __Pyx_INCREF(__pyx_kp_u__11);
21064 4 : __pyx_t_3 += 1;
21065 4 : __Pyx_GIVEREF(__pyx_kp_u__11);
21066 4 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__11);
21067 4 : __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_v_lower_bound), __pyx_n_u_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
21068 4 : __Pyx_GOTREF(__pyx_t_2);
21069 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
21070 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
21071 4 : __Pyx_GIVEREF(__pyx_t_2);
21072 4 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
21073 4 : __pyx_t_2 = 0;
21074 4 : __Pyx_INCREF(__pyx_kp_u__12);
21075 4 : __pyx_t_3 += 2;
21076 4 : __Pyx_GIVEREF(__pyx_kp_u__12);
21077 4 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__12);
21078 4 : __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_v_upper_bound), __pyx_n_u_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
21079 4 : __Pyx_GOTREF(__pyx_t_2);
21080 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
21081 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
21082 4 : __Pyx_GIVEREF(__pyx_t_2);
21083 4 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_2);
21084 4 : __pyx_t_2 = 0;
21085 4 : __Pyx_INCREF(__pyx_kp_u__13);
21086 4 : __pyx_t_3 += 1;
21087 4 : __Pyx_GIVEREF(__pyx_kp_u__13);
21088 4 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__13);
21089 4 : __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
21090 4 : __Pyx_GOTREF(__pyx_t_2);
21091 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21092 : __pyx_v_int_range = __pyx_t_2;
21093 4 : __pyx_t_2 = 0;
21094 : }
21095 4 : __pyx_L5:;
21096 :
21097 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":88
21098 : * else:
21099 : * int_range = '[%d, %d]' % (lower_bound, upper_bound)
21100 : * return ('Option "%s" is "%s", but only values in %s are allowed. ' # <<<<<<<<<<<<<<
21101 : * 'Using default: %d.' % (name.decode(), str(val), int_range, default_value))
21102 : *
21103 : */
21104 4 : __Pyx_XDECREF(__pyx_r);
21105 4 : __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
21106 4 : __Pyx_GOTREF(__pyx_t_2);
21107 4 : __pyx_t_3 = 0;
21108 4 : __pyx_t_4 = 127;
21109 4 : __Pyx_INCREF(__pyx_kp_u_Option);
21110 4 : __pyx_t_3 += 8;
21111 4 : __Pyx_GIVEREF(__pyx_kp_u_Option);
21112 4 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Option);
21113 :
21114 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":89
21115 : * int_range = '[%d, %d]' % (lower_bound, upper_bound)
21116 : * return ('Option "%s" is "%s", but only values in %s are allowed. '
21117 : * 'Using default: %d.' % (name.decode(), str(val), int_range, default_value)) # <<<<<<<<<<<<<<
21118 : *
21119 : * # DOUBLE
21120 : */
21121 8 : __pyx_t_5 = __Pyx_decode_cpp_string(__pyx_v_name, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
21122 4 : __Pyx_GOTREF(__pyx_t_5);
21123 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
21124 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21125 4 : __Pyx_GIVEREF(__pyx_t_5);
21126 4 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
21127 4 : __pyx_t_5 = 0;
21128 4 : __Pyx_INCREF(__pyx_kp_u_is);
21129 4 : __pyx_t_3 += 6;
21130 4 : __Pyx_GIVEREF(__pyx_kp_u_is);
21131 4 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is);
21132 4 : __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
21133 4 : __Pyx_GOTREF(__pyx_t_5);
21134 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
21135 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21136 4 : __Pyx_GIVEREF(__pyx_t_5);
21137 4 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
21138 4 : __pyx_t_5 = 0;
21139 4 : __Pyx_INCREF(__pyx_kp_u_but_only_values_in);
21140 4 : __pyx_t_3 += 22;
21141 4 : __Pyx_GIVEREF(__pyx_kp_u_but_only_values_in);
21142 4 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_but_only_values_in);
21143 4 : __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_int_range), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
21144 4 : __Pyx_GOTREF(__pyx_t_5);
21145 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
21146 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21147 4 : __Pyx_GIVEREF(__pyx_t_5);
21148 4 : PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5);
21149 4 : __pyx_t_5 = 0;
21150 4 : __Pyx_INCREF(__pyx_kp_u_are_allowed_Using_default);
21151 4 : __pyx_t_3 += 29;
21152 4 : __Pyx_GIVEREF(__pyx_kp_u_are_allowed_Using_default);
21153 4 : PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u_are_allowed_Using_default);
21154 4 : __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_v_default_value), __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
21155 4 : __Pyx_GOTREF(__pyx_t_5);
21156 4 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
21157 4 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21158 4 : __Pyx_GIVEREF(__pyx_t_5);
21159 4 : PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_5);
21160 4 : __pyx_t_5 = 0;
21161 4 : __Pyx_INCREF(__pyx_kp_u__2);
21162 4 : __pyx_t_3 += 1;
21163 4 : __Pyx_GIVEREF(__pyx_kp_u__2);
21164 4 : PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u__2);
21165 :
21166 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":88
21167 : * else:
21168 : * int_range = '[%d, %d]' % (lower_bound, upper_bound)
21169 : * return ('Option "%s" is "%s", but only values in %s are allowed. ' # <<<<<<<<<<<<<<
21170 : * 'Using default: %d.' % (name.decode(), str(val), int_range, default_value))
21171 : *
21172 : */
21173 4 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 9, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
21174 4 : __Pyx_GOTREF(__pyx_t_5);
21175 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21176 4 : __pyx_r = ((PyObject*)__pyx_t_5);
21177 4 : __pyx_t_5 = 0;
21178 4 : goto __pyx_L0;
21179 :
21180 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":80
21181 : *
21182 : * # INT
21183 : * if r.type == HighsOptionTypeINT: # <<<<<<<<<<<<<<
21184 : * lower_bound = int((<OptionRecordInt*> r).lower_bound)
21185 : * upper_bound = int((<OptionRecordInt*> r).upper_bound)
21186 : */
21187 : }
21188 :
21189 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":92
21190 : *
21191 : * # DOUBLE
21192 : * if r.type == HighsOptionTypeDOUBLE: # <<<<<<<<<<<<<<
21193 : * lower_bound = (<OptionRecordDouble*> r).lower_bound
21194 : * upper_bound = (<OptionRecordDouble*> r).upper_bound
21195 : */
21196 10 : __pyx_t_1 = (__pyx_v_r->type == HighsOptionType::kDouble);
21197 10 : if (__pyx_t_1) {
21198 :
21199 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":93
21200 : * # DOUBLE
21201 : * if r.type == HighsOptionTypeDOUBLE:
21202 : * lower_bound = (<OptionRecordDouble*> r).lower_bound # <<<<<<<<<<<<<<
21203 : * upper_bound = (<OptionRecordDouble*> r).upper_bound
21204 : * default_value = (<OptionRecordDouble*> r).default_value
21205 : */
21206 8 : __pyx_t_5 = PyFloat_FromDouble(((OptionRecordDouble *)__pyx_v_r)->lower_bound); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
21207 8 : __Pyx_GOTREF(__pyx_t_5);
21208 8 : __pyx_v_lower_bound = __pyx_t_5;
21209 8 : __pyx_t_5 = 0;
21210 :
21211 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":94
21212 : * if r.type == HighsOptionTypeDOUBLE:
21213 : * lower_bound = (<OptionRecordDouble*> r).lower_bound
21214 : * upper_bound = (<OptionRecordDouble*> r).upper_bound # <<<<<<<<<<<<<<
21215 : * default_value = (<OptionRecordDouble*> r).default_value
21216 : * return ('Option "%s" is "%s", but only values in (%g, %g) are allowed. '
21217 : */
21218 8 : __pyx_t_5 = PyFloat_FromDouble(((OptionRecordDouble *)__pyx_v_r)->upper_bound); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
21219 8 : __Pyx_GOTREF(__pyx_t_5);
21220 8 : __pyx_v_upper_bound = __pyx_t_5;
21221 8 : __pyx_t_5 = 0;
21222 :
21223 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":95
21224 : * lower_bound = (<OptionRecordDouble*> r).lower_bound
21225 : * upper_bound = (<OptionRecordDouble*> r).upper_bound
21226 : * default_value = (<OptionRecordDouble*> r).default_value # <<<<<<<<<<<<<<
21227 : * return ('Option "%s" is "%s", but only values in (%g, %g) are allowed. '
21228 : * 'Using default: %g.' % (name.decode(), str(val), lower_bound, upper_bound, default_value))
21229 : */
21230 8 : __pyx_t_5 = PyFloat_FromDouble(((OptionRecordDouble *)__pyx_v_r)->default_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
21231 8 : __Pyx_GOTREF(__pyx_t_5);
21232 8 : __pyx_v_default_value = __pyx_t_5;
21233 8 : __pyx_t_5 = 0;
21234 :
21235 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":96
21236 : * upper_bound = (<OptionRecordDouble*> r).upper_bound
21237 : * default_value = (<OptionRecordDouble*> r).default_value
21238 : * return ('Option "%s" is "%s", but only values in (%g, %g) are allowed. ' # <<<<<<<<<<<<<<
21239 : * 'Using default: %g.' % (name.decode(), str(val), lower_bound, upper_bound, default_value))
21240 : *
21241 : */
21242 8 : __Pyx_XDECREF(__pyx_r);
21243 :
21244 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":97
21245 : * default_value = (<OptionRecordDouble*> r).default_value
21246 : * return ('Option "%s" is "%s", but only values in (%g, %g) are allowed. '
21247 : * 'Using default: %g.' % (name.decode(), str(val), lower_bound, upper_bound, default_value)) # <<<<<<<<<<<<<<
21248 : *
21249 : * # STRING
21250 : */
21251 16 : __pyx_t_5 = __Pyx_decode_cpp_string(__pyx_v_name, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
21252 8 : __Pyx_GOTREF(__pyx_t_5);
21253 8 : __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
21254 8 : __Pyx_GOTREF(__pyx_t_2);
21255 8 : __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
21256 8 : __Pyx_GOTREF(__pyx_t_6);
21257 8 : __Pyx_GIVEREF(__pyx_t_5);
21258 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error);
21259 8 : __Pyx_GIVEREF(__pyx_t_2);
21260 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error);
21261 8 : __Pyx_INCREF(__pyx_v_lower_bound);
21262 8 : __Pyx_GIVEREF(__pyx_v_lower_bound);
21263 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_lower_bound)) __PYX_ERR(0, 97, __pyx_L1_error);
21264 8 : __Pyx_INCREF(__pyx_v_upper_bound);
21265 8 : __Pyx_GIVEREF(__pyx_v_upper_bound);
21266 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_upper_bound)) __PYX_ERR(0, 97, __pyx_L1_error);
21267 8 : __Pyx_INCREF(__pyx_v_default_value);
21268 8 : __Pyx_GIVEREF(__pyx_v_default_value);
21269 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_default_value)) __PYX_ERR(0, 97, __pyx_L1_error);
21270 8 : __pyx_t_5 = 0;
21271 8 : __pyx_t_2 = 0;
21272 8 : __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Option_s_is_s_but_only_values_in, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
21273 8 : __Pyx_GOTREF(__pyx_t_2);
21274 8 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21275 8 : __pyx_r = ((PyObject*)__pyx_t_2);
21276 8 : __pyx_t_2 = 0;
21277 8 : goto __pyx_L0;
21278 :
21279 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":92
21280 : *
21281 : * # DOUBLE
21282 : * if r.type == HighsOptionTypeDOUBLE: # <<<<<<<<<<<<<<
21283 : * lower_bound = (<OptionRecordDouble*> r).lower_bound
21284 : * upper_bound = (<OptionRecordDouble*> r).upper_bound
21285 : */
21286 : }
21287 :
21288 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":100
21289 : *
21290 : * # STRING
21291 : * if r.type == HighsOptionTypeSTRING: # <<<<<<<<<<<<<<
21292 : * if valid_set is not None:
21293 : * descr = 'but only values in %s are allowed. ' % str(set(valid_set))
21294 : */
21295 2 : __pyx_t_1 = (__pyx_v_r->type == HighsOptionType::kString);
21296 2 : if (__pyx_t_1) {
21297 :
21298 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":101
21299 : * # STRING
21300 : * if r.type == HighsOptionTypeSTRING:
21301 : * if valid_set is not None: # <<<<<<<<<<<<<<
21302 : * descr = 'but only values in %s are allowed. ' % str(set(valid_set))
21303 : * else:
21304 : */
21305 2 : __pyx_t_1 = (__pyx_v_valid_set != Py_None);
21306 2 : if (__pyx_t_1) {
21307 :
21308 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":102
21309 : * if r.type == HighsOptionTypeSTRING:
21310 : * if valid_set is not None:
21311 : * descr = 'but only values in %s are allowed. ' % str(set(valid_set)) # <<<<<<<<<<<<<<
21312 : * else:
21313 : * descr = 'but this is an invalid value. %s. ' % r.description.decode()
21314 : */
21315 2 : __pyx_t_2 = PySet_New(__pyx_v_valid_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
21316 2 : __Pyx_GOTREF(__pyx_t_2);
21317 2 : __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error)
21318 2 : __Pyx_GOTREF(__pyx_t_6);
21319 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21320 2 : __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_but_only_values_in_s_are_allowed, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
21321 2 : __Pyx_GOTREF(__pyx_t_2);
21322 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21323 2 : __pyx_v_descr = ((PyObject*)__pyx_t_2);
21324 2 : __pyx_t_2 = 0;
21325 :
21326 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":101
21327 : * # STRING
21328 : * if r.type == HighsOptionTypeSTRING:
21329 : * if valid_set is not None: # <<<<<<<<<<<<<<
21330 : * descr = 'but only values in %s are allowed. ' % str(set(valid_set))
21331 : * else:
21332 : */
21333 2 : goto __pyx_L8;
21334 : }
21335 :
21336 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":104
21337 : * descr = 'but only values in %s are allowed. ' % str(set(valid_set))
21338 : * else:
21339 : * descr = 'but this is an invalid value. %s. ' % r.description.decode() # <<<<<<<<<<<<<<
21340 : * default_value = (<OptionRecordString*> r).default_value.decode()
21341 : * return ('Option "%s" is "%s", '
21342 : */
21343 0 : /*else*/ {
21344 0 : __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_r->description, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
21345 0 : __Pyx_GOTREF(__pyx_t_2);
21346 0 : __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_but_this_is_an_invalid_value_s, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
21347 0 : __Pyx_GOTREF(__pyx_t_6);
21348 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21349 : __pyx_v_descr = ((PyObject*)__pyx_t_6);
21350 2 : __pyx_t_6 = 0;
21351 : }
21352 2 : __pyx_L8:;
21353 :
21354 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":105
21355 : * else:
21356 : * descr = 'but this is an invalid value. %s. ' % r.description.decode()
21357 : * default_value = (<OptionRecordString*> r).default_value.decode() # <<<<<<<<<<<<<<
21358 : * return ('Option "%s" is "%s", '
21359 : * '%s'
21360 : */
21361 4 : __pyx_t_6 = __Pyx_decode_cpp_string(((OptionRecordString *)__pyx_v_r)->default_value, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
21362 2 : __Pyx_GOTREF(__pyx_t_6);
21363 2 : __pyx_v_default_value = __pyx_t_6;
21364 2 : __pyx_t_6 = 0;
21365 :
21366 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":106
21367 : * descr = 'but this is an invalid value. %s. ' % r.description.decode()
21368 : * default_value = (<OptionRecordString*> r).default_value.decode()
21369 : * return ('Option "%s" is "%s", ' # <<<<<<<<<<<<<<
21370 : * '%s'
21371 : * 'Using default: %s.' % (name.decode(), str(val), descr, default_value))
21372 : */
21373 2 : __Pyx_XDECREF(__pyx_r);
21374 2 : __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error)
21375 2 : __Pyx_GOTREF(__pyx_t_6);
21376 2 : __pyx_t_3 = 0;
21377 2 : __pyx_t_4 = 127;
21378 2 : __Pyx_INCREF(__pyx_kp_u_Option);
21379 2 : __pyx_t_3 += 8;
21380 2 : __Pyx_GIVEREF(__pyx_kp_u_Option);
21381 2 : PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Option);
21382 :
21383 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":108
21384 : * return ('Option "%s" is "%s", '
21385 : * '%s'
21386 : * 'Using default: %s.' % (name.decode(), str(val), descr, default_value)) # <<<<<<<<<<<<<<
21387 : *
21388 : * # We don't know what type (should be unreachable)?
21389 : */
21390 4 : __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_name, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
21391 2 : __Pyx_GOTREF(__pyx_t_2);
21392 2 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
21393 2 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
21394 2 : __Pyx_GIVEREF(__pyx_t_2);
21395 2 : PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
21396 2 : __pyx_t_2 = 0;
21397 2 : __Pyx_INCREF(__pyx_kp_u_is);
21398 2 : __pyx_t_3 += 6;
21399 2 : __Pyx_GIVEREF(__pyx_kp_u_is);
21400 2 : PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_is);
21401 2 : __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
21402 2 : __Pyx_GOTREF(__pyx_t_2);
21403 2 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
21404 2 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
21405 2 : __Pyx_GIVEREF(__pyx_t_2);
21406 2 : PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_2);
21407 2 : __pyx_t_2 = 0;
21408 2 : __Pyx_INCREF(__pyx_kp_u__14);
21409 2 : __pyx_t_3 += 3;
21410 2 : __Pyx_GIVEREF(__pyx_kp_u__14);
21411 2 : PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__14);
21412 2 : __Pyx_INCREF(__pyx_v_descr);
21413 2 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_descr) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_descr) : __pyx_t_4;
21414 2 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_descr);
21415 2 : __Pyx_GIVEREF(__pyx_v_descr);
21416 2 : PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_descr);
21417 2 : __Pyx_INCREF(__pyx_kp_u_Using_default);
21418 2 : __pyx_t_3 += 15;
21419 2 : __Pyx_GIVEREF(__pyx_kp_u_Using_default);
21420 2 : PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u_Using_default);
21421 2 : __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_default_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
21422 2 : __Pyx_GOTREF(__pyx_t_2);
21423 2 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
21424 2 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
21425 2 : __Pyx_GIVEREF(__pyx_t_2);
21426 2 : PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_t_2);
21427 2 : __pyx_t_2 = 0;
21428 2 : __Pyx_INCREF(__pyx_kp_u__2);
21429 2 : __pyx_t_3 += 1;
21430 2 : __Pyx_GIVEREF(__pyx_kp_u__2);
21431 2 : PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_kp_u__2);
21432 :
21433 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":106
21434 : * descr = 'but this is an invalid value. %s. ' % r.description.decode()
21435 : * default_value = (<OptionRecordString*> r).default_value.decode()
21436 : * return ('Option "%s" is "%s", ' # <<<<<<<<<<<<<<
21437 : * '%s'
21438 : * 'Using default: %s.' % (name.decode(), str(val), descr, default_value))
21439 : */
21440 2 : __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_6, 9, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
21441 2 : __Pyx_GOTREF(__pyx_t_2);
21442 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21443 2 : __pyx_r = ((PyObject*)__pyx_t_2);
21444 2 : __pyx_t_2 = 0;
21445 2 : goto __pyx_L0;
21446 :
21447 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":100
21448 : *
21449 : * # STRING
21450 : * if r.type == HighsOptionTypeSTRING: # <<<<<<<<<<<<<<
21451 : * if valid_set is not None:
21452 : * descr = 'but only values in %s are allowed. ' % str(set(valid_set))
21453 : */
21454 : }
21455 :
21456 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":111
21457 : *
21458 : * # We don't know what type (should be unreachable)?
21459 : * return('Option "%s" is "%s", but this is not a valid value. ' # <<<<<<<<<<<<<<
21460 : * 'See documentation for valid options. '
21461 : * 'Using default.' % (name.decode(), str(val)))
21462 : */
21463 0 : __Pyx_XDECREF(__pyx_r);
21464 0 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
21465 0 : __Pyx_GOTREF(__pyx_t_2);
21466 0 : __pyx_t_3 = 0;
21467 0 : __pyx_t_4 = 127;
21468 0 : __Pyx_INCREF(__pyx_kp_u_Option);
21469 0 : __pyx_t_3 += 8;
21470 0 : __Pyx_GIVEREF(__pyx_kp_u_Option);
21471 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Option);
21472 :
21473 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":113
21474 : * return('Option "%s" is "%s", but this is not a valid value. '
21475 : * 'See documentation for valid options. '
21476 : * 'Using default.' % (name.decode(), str(val))) # <<<<<<<<<<<<<<
21477 : *
21478 : * cdef void apply_options(dict options, Highs & highs):
21479 : */
21480 0 : __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_v_name, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
21481 0 : __Pyx_GOTREF(__pyx_t_6);
21482 0 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
21483 0 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
21484 0 : __Pyx_GIVEREF(__pyx_t_6);
21485 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
21486 0 : __pyx_t_6 = 0;
21487 0 : __Pyx_INCREF(__pyx_kp_u_is);
21488 0 : __pyx_t_3 += 6;
21489 0 : __Pyx_GIVEREF(__pyx_kp_u_is);
21490 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is);
21491 0 : __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
21492 0 : __Pyx_GOTREF(__pyx_t_6);
21493 0 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
21494 0 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
21495 0 : __Pyx_GIVEREF(__pyx_t_6);
21496 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
21497 0 : __pyx_t_6 = 0;
21498 0 : __Pyx_INCREF(__pyx_kp_u_but_this_is_not_a_valid_value_S);
21499 0 : __pyx_t_3 += 85;
21500 0 : __Pyx_GIVEREF(__pyx_kp_u_but_this_is_not_a_valid_value_S);
21501 0 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_but_this_is_not_a_valid_value_S);
21502 :
21503 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":111
21504 : *
21505 : * # We don't know what type (should be unreachable)?
21506 : * return('Option "%s" is "%s", but this is not a valid value. ' # <<<<<<<<<<<<<<
21507 : * 'See documentation for valid options. '
21508 : * 'Using default.' % (name.decode(), str(val)))
21509 : */
21510 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
21511 0 : __Pyx_GOTREF(__pyx_t_6);
21512 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21513 0 : __pyx_r = ((PyObject*)__pyx_t_6);
21514 0 : __pyx_t_6 = 0;
21515 0 : goto __pyx_L0;
21516 :
21517 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":70
21518 : *
21519 : *
21520 : * cdef str _opt_warning(string name, val, valid_set=None): # <<<<<<<<<<<<<<
21521 : * cdef OptionRecord * r = _ref_opt_lookup[name]
21522 : *
21523 : */
21524 :
21525 : /* function exit code */
21526 0 : __pyx_L1_error:;
21527 0 : __Pyx_XDECREF(__pyx_t_2);
21528 0 : __Pyx_XDECREF(__pyx_t_5);
21529 0 : __Pyx_XDECREF(__pyx_t_6);
21530 0 : __Pyx_AddTraceback("scipy.optimize._highs.cython.src._highs_wrapper._opt_warning", __pyx_clineno, __pyx_lineno, __pyx_filename);
21531 0 : __pyx_r = 0;
21532 18 : __pyx_L0:;
21533 18 : __Pyx_XDECREF(__pyx_v_default_value);
21534 18 : __Pyx_XDECREF(__pyx_v_lower_bound);
21535 18 : __Pyx_XDECREF(__pyx_v_upper_bound);
21536 18 : __Pyx_XDECREF(__pyx_v_int_range);
21537 18 : __Pyx_XDECREF(__pyx_v_descr);
21538 18 : __Pyx_XGIVEREF(__pyx_r);
21539 18 : __Pyx_RefNannyFinishContext();
21540 18 : return __pyx_r;
21541 : }
21542 :
21543 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":115
21544 : * 'Using default.' % (name.decode(), str(val)))
21545 : *
21546 : * cdef void apply_options(dict options, Highs & highs): # <<<<<<<<<<<<<<
21547 : * '''Take options from dictionary and apply to HiGHS object.'''
21548 : *
21549 : */
21550 :
21551 1001 : static void __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_apply_options(PyObject *__pyx_v_options, Highs &__pyx_v_highs) {
21552 1001 : HighsStatus __pyx_v_opt_status;
21553 1001 : PyObject *__pyx_v_opt = NULL;
21554 1001 : PyObject *__pyx_v_val = NULL;
21555 1001 : PyObject *__pyx_v_val0 = NULL;
21556 : __Pyx_RefNannyDeclarations
21557 1001 : PyObject *__pyx_t_1 = NULL;
21558 1001 : Py_ssize_t __pyx_t_2;
21559 1001 : Py_ssize_t __pyx_t_3;
21560 1001 : int __pyx_t_4;
21561 1001 : PyObject *__pyx_t_5 = NULL;
21562 1001 : PyObject *__pyx_t_6 = NULL;
21563 1001 : int __pyx_t_7;
21564 1001 : int __pyx_t_8;
21565 1001 : int __pyx_t_9;
21566 1001 : PyObject *__pyx_t_10 = NULL;
21567 1001 : PyObject *__pyx_t_11 = NULL;
21568 1001 : PyObject *__pyx_t_12 = NULL;
21569 1001 : unsigned int __pyx_t_13;
21570 1001 : std::string __pyx_t_14;
21571 1001 : double __pyx_t_15;
21572 1001 : std::string __pyx_t_16;
21573 1001 : struct __pyx_opt_args_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning __pyx_t_17;
21574 1001 : bool __pyx_t_18;
21575 1001 : int __pyx_lineno = 0;
21576 1001 : const char *__pyx_filename = NULL;
21577 1001 : int __pyx_clineno = 0;
21578 1001 : __Pyx_RefNannySetupContext("apply_options", 1);
21579 :
21580 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":119
21581 : *
21582 : * # Initialize for error checking
21583 : * cdef HighsStatus opt_status = HighsStatusOK # <<<<<<<<<<<<<<
21584 : *
21585 : * # Do all the ints
21586 : */
21587 1001 : __pyx_v_opt_status = HighsStatus::kOk;
21588 :
21589 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":122
21590 : *
21591 : * # Do all the ints
21592 : * for opt in set([ # <<<<<<<<<<<<<<
21593 : * 'allowed_simplex_cost_scale_factor',
21594 : * 'allowed_simplex_matrix_scale_factor',
21595 : */
21596 1001 : __pyx_t_2 = 0;
21597 1001 : __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
21598 1001 : __Pyx_GOTREF(__pyx_t_5);
21599 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_allowed_simplex_cost_scale_facto) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21600 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_allowed_simplex_matrix_scale_fac) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21601 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_dual_simplex_cleanup_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21602 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_ipm_iteration_limit) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21603 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_keep_n_rows) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21604 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_threads) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21605 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_mip_max_nodes) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21606 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_highs_debug_level) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21607 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_crash_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21608 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_dual_edge_weight_strateg) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21609 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_dualise_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21610 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_iteration_limit) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21611 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_permute_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21612 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_price_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21613 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_primal_edge_weight_strat) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21614 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_scale_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21615 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_strategy) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21616 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_simplex_update_limit) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21617 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_small_matrix_value) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
21618 1001 : __pyx_t_6 = __Pyx_set_iterator(__pyx_t_5, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
21619 1001 : __Pyx_GOTREF(__pyx_t_6);
21620 1001 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21621 1001 : __Pyx_XDECREF(__pyx_t_1);
21622 1001 : __pyx_t_1 = __pyx_t_6;
21623 1001 : __pyx_t_6 = 0;
21624 20020 : while (1) {
21625 20020 : __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, __pyx_t_4);
21626 20020 : if (unlikely(__pyx_t_7 == 0)) break;
21627 19019 : if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 122, __pyx_L1_error)
21628 19019 : __Pyx_GOTREF(__pyx_t_6);
21629 19019 : __Pyx_XDECREF_SET(__pyx_v_opt, __pyx_t_6);
21630 19019 : __pyx_t_6 = 0;
21631 :
21632 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":143
21633 : * 'small_matrix_value',
21634 : * ]):
21635 : * val = options.get(opt, None) # <<<<<<<<<<<<<<
21636 : * if val is not None:
21637 : * if not isinstance(val, int):
21638 : */
21639 19019 : if (unlikely(__pyx_v_options == Py_None)) {
21640 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
21641 0 : __PYX_ERR(0, 143, __pyx_L1_error)
21642 : }
21643 19019 : __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_options, __pyx_v_opt, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
21644 19019 : __Pyx_GOTREF(__pyx_t_6);
21645 19019 : __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
21646 19019 : __pyx_t_6 = 0;
21647 :
21648 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":144
21649 : * ]):
21650 : * val = options.get(opt, None)
21651 : * if val is not None: # <<<<<<<<<<<<<<
21652 : * if not isinstance(val, int):
21653 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21654 : */
21655 19019 : __pyx_t_8 = (__pyx_v_val != Py_None);
21656 19019 : if (__pyx_t_8) {
21657 :
21658 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":145
21659 : * val = options.get(opt, None)
21660 : * if val is not None:
21661 : * if not isinstance(val, int): # <<<<<<<<<<<<<<
21662 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21663 : * else:
21664 : */
21665 2273 : __pyx_t_8 = PyInt_Check(__pyx_v_val);
21666 2273 : __pyx_t_9 = (!__pyx_t_8);
21667 2273 : if (__pyx_t_9) {
21668 :
21669 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":146
21670 : * if val is not None:
21671 : * if not isinstance(val, int):
21672 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
21673 : * else:
21674 : * opt_status = highs.setHighsOptionValueInt(opt.encode(), val)
21675 : */
21676 0 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
21677 0 : __Pyx_GOTREF(__pyx_t_5);
21678 0 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L1_error)
21679 0 : __Pyx_GOTREF(__pyx_t_11);
21680 0 : __pyx_t_12 = NULL;
21681 0 : __pyx_t_13 = 0;
21682 : #if CYTHON_UNPACK_METHODS
21683 0 : if (likely(PyMethod_Check(__pyx_t_11))) {
21684 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
21685 0 : if (likely(__pyx_t_12)) {
21686 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
21687 0 : __Pyx_INCREF(__pyx_t_12);
21688 0 : __Pyx_INCREF(function);
21689 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
21690 : __pyx_t_13 = 1;
21691 : }
21692 : }
21693 : #endif
21694 0 : {
21695 0 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
21696 0 : __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
21697 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
21698 0 : if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
21699 0 : __Pyx_GOTREF(__pyx_t_10);
21700 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21701 : }
21702 0 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
21703 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21704 0 : __pyx_t_10 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
21705 0 : __Pyx_GOTREF(__pyx_t_10);
21706 0 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L1_error)
21707 0 : __Pyx_GOTREF(__pyx_t_11);
21708 0 : __pyx_t_12 = NULL;
21709 0 : __pyx_t_13 = 0;
21710 : #if CYTHON_UNPACK_METHODS
21711 0 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
21712 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
21713 0 : if (likely(__pyx_t_12)) {
21714 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
21715 0 : __Pyx_INCREF(__pyx_t_12);
21716 0 : __Pyx_INCREF(function);
21717 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
21718 : __pyx_t_13 = 1;
21719 : }
21720 : }
21721 : #endif
21722 0 : {
21723 0 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11};
21724 0 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
21725 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
21726 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21727 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21728 0 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
21729 0 : __Pyx_GOTREF(__pyx_t_6);
21730 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21731 : }
21732 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21733 :
21734 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":145
21735 : * val = options.get(opt, None)
21736 : * if val is not None:
21737 : * if not isinstance(val, int): # <<<<<<<<<<<<<<
21738 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21739 : * else:
21740 : */
21741 0 : goto __pyx_L6;
21742 : }
21743 :
21744 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":148
21745 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21746 : * else:
21747 : * opt_status = highs.setHighsOptionValueInt(opt.encode(), val) # <<<<<<<<<<<<<<
21748 : * if opt_status != HighsStatusOK:
21749 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21750 : */
21751 2273 : /*else*/ {
21752 2273 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
21753 2273 : __Pyx_GOTREF(__pyx_t_5);
21754 2273 : __pyx_t_11 = NULL;
21755 2273 : __pyx_t_13 = 0;
21756 : #if CYTHON_UNPACK_METHODS
21757 2273 : if (likely(PyMethod_Check(__pyx_t_5))) {
21758 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
21759 0 : if (likely(__pyx_t_11)) {
21760 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
21761 0 : __Pyx_INCREF(__pyx_t_11);
21762 0 : __Pyx_INCREF(function);
21763 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
21764 : __pyx_t_13 = 1;
21765 : }
21766 : }
21767 : #endif
21768 2273 : {
21769 2273 : PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
21770 2273 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
21771 2273 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
21772 2273 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
21773 2273 : __Pyx_GOTREF(__pyx_t_6);
21774 2273 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21775 : }
21776 2273 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
21777 2273 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21778 2273 : __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
21779 2273 : __pyx_v_opt_status = __pyx_v_highs.setOptionValue(__pyx_t_14, __pyx_t_7);
21780 :
21781 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":149
21782 : * else:
21783 : * opt_status = highs.setHighsOptionValueInt(opt.encode(), val)
21784 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
21785 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21786 : * else:
21787 : */
21788 2273 : __pyx_t_9 = (__pyx_v_opt_status != HighsStatus::kOk);
21789 2273 : if (__pyx_t_9) {
21790 :
21791 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":150
21792 : * opt_status = highs.setHighsOptionValueInt(opt.encode(), val)
21793 : * if opt_status != HighsStatusOK:
21794 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
21795 : * else:
21796 : * if opt == "threads":
21797 : */
21798 4 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
21799 4 : __Pyx_GOTREF(__pyx_t_5);
21800 4 : __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error)
21801 4 : __Pyx_GOTREF(__pyx_t_10);
21802 4 : __pyx_t_12 = NULL;
21803 4 : __pyx_t_13 = 0;
21804 : #if CYTHON_UNPACK_METHODS
21805 4 : if (likely(PyMethod_Check(__pyx_t_10))) {
21806 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
21807 0 : if (likely(__pyx_t_12)) {
21808 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
21809 0 : __Pyx_INCREF(__pyx_t_12);
21810 0 : __Pyx_INCREF(function);
21811 0 : __Pyx_DECREF_SET(__pyx_t_10, function);
21812 : __pyx_t_13 = 1;
21813 : }
21814 : }
21815 : #endif
21816 4 : {
21817 4 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
21818 4 : __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
21819 4 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
21820 4 : if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L1_error)
21821 4 : __Pyx_GOTREF(__pyx_t_11);
21822 4 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21823 : }
21824 4 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error)
21825 4 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21826 4 : __pyx_t_11 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L1_error)
21827 4 : __Pyx_GOTREF(__pyx_t_11);
21828 4 : __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error)
21829 4 : __Pyx_GOTREF(__pyx_t_10);
21830 4 : __pyx_t_12 = NULL;
21831 4 : __pyx_t_13 = 0;
21832 : #if CYTHON_UNPACK_METHODS
21833 4 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
21834 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
21835 0 : if (likely(__pyx_t_12)) {
21836 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
21837 0 : __Pyx_INCREF(__pyx_t_12);
21838 0 : __Pyx_INCREF(function);
21839 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
21840 : __pyx_t_13 = 1;
21841 : }
21842 : }
21843 : #endif
21844 4 : {
21845 4 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_10};
21846 4 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
21847 4 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
21848 4 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21849 4 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21850 4 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
21851 4 : __Pyx_GOTREF(__pyx_t_6);
21852 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21853 : }
21854 4 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21855 :
21856 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":149
21857 : * else:
21858 : * opt_status = highs.setHighsOptionValueInt(opt.encode(), val)
21859 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
21860 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21861 : * else:
21862 : */
21863 4 : goto __pyx_L7;
21864 : }
21865 :
21866 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":152
21867 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21868 : * else:
21869 : * if opt == "threads": # <<<<<<<<<<<<<<
21870 : * highs.resetGlobalScheduler(blocking=True)
21871 : *
21872 : */
21873 2269 : /*else*/ {
21874 2269 : __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_opt, __pyx_n_u_threads, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 152, __pyx_L1_error)
21875 2269 : if (__pyx_t_9) {
21876 :
21877 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":153
21878 : * else:
21879 : * if opt == "threads":
21880 : * highs.resetGlobalScheduler(blocking=True) # <<<<<<<<<<<<<<
21881 : *
21882 : * # Do all the doubles
21883 : */
21884 0 : __pyx_v_highs.resetGlobalScheduler(1);
21885 :
21886 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":152
21887 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21888 : * else:
21889 : * if opt == "threads": # <<<<<<<<<<<<<<
21890 : * highs.resetGlobalScheduler(blocking=True)
21891 : *
21892 : */
21893 : }
21894 : }
21895 2269 : __pyx_L7:;
21896 : }
21897 : __pyx_L6:;
21898 :
21899 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":144
21900 : * ]):
21901 : * val = options.get(opt, None)
21902 : * if val is not None: # <<<<<<<<<<<<<<
21903 : * if not isinstance(val, int):
21904 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21905 : */
21906 : }
21907 : }
21908 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21909 :
21910 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":156
21911 : *
21912 : * # Do all the doubles
21913 : * for opt in set([ # <<<<<<<<<<<<<<
21914 : * 'dual_feasibility_tolerance',
21915 : * 'dual_objective_value_upper_bound',
21916 : */
21917 1001 : __pyx_t_3 = 0;
21918 1001 : __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
21919 1001 : __Pyx_GOTREF(__pyx_t_6);
21920 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_dual_feasibility_tolerance) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21921 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_dual_objective_value_upper_bound) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21922 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_dual_simplex_cost_perturbation_m) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21923 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_dual_steepest_edge_weight_log_er) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21924 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_infinite_bound) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21925 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_infinite_cost) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21926 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_ipm_optimality_tolerance) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21927 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_large_matrix_value) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21928 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_primal_feasibility_tolerance) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21929 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_simplex_initial_condition_tolera) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21930 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_small_matrix_value) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21931 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_start_crossover_tolerance) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21932 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_time_limit) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21933 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_mip_rel_gap) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
21934 1001 : __pyx_t_5 = __Pyx_set_iterator(__pyx_t_6, 1, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
21935 1001 : __Pyx_GOTREF(__pyx_t_5);
21936 1001 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21937 1001 : __Pyx_XDECREF(__pyx_t_1);
21938 1001 : __pyx_t_1 = __pyx_t_5;
21939 1001 : __pyx_t_5 = 0;
21940 15015 : while (1) {
21941 15015 : __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_5, __pyx_t_4);
21942 15015 : if (unlikely(__pyx_t_7 == 0)) break;
21943 14014 : if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 156, __pyx_L1_error)
21944 14014 : __Pyx_GOTREF(__pyx_t_5);
21945 14014 : __Pyx_XDECREF_SET(__pyx_v_opt, __pyx_t_5);
21946 14014 : __pyx_t_5 = 0;
21947 :
21948 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":172
21949 : * 'mip_rel_gap'
21950 : * ]):
21951 : * val = options.get(opt, None) # <<<<<<<<<<<<<<
21952 : * if val is not None:
21953 : * if not isinstance(val, numbers.Number):
21954 : */
21955 14014 : if (unlikely(__pyx_v_options == Py_None)) {
21956 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
21957 0 : __PYX_ERR(0, 172, __pyx_L1_error)
21958 : }
21959 14014 : __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_options, __pyx_v_opt, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
21960 14014 : __Pyx_GOTREF(__pyx_t_5);
21961 14014 : __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
21962 14014 : __pyx_t_5 = 0;
21963 :
21964 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":173
21965 : * ]):
21966 : * val = options.get(opt, None)
21967 : * if val is not None: # <<<<<<<<<<<<<<
21968 : * if not isinstance(val, numbers.Number):
21969 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21970 : */
21971 14014 : __pyx_t_9 = (__pyx_v_val != Py_None);
21972 14014 : if (__pyx_t_9) {
21973 :
21974 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":174
21975 : * val = options.get(opt, None)
21976 : * if val is not None:
21977 : * if not isinstance(val, numbers.Number): # <<<<<<<<<<<<<<
21978 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
21979 : * else:
21980 : */
21981 10 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numbers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
21982 10 : __Pyx_GOTREF(__pyx_t_5);
21983 10 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Number); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
21984 10 : __Pyx_GOTREF(__pyx_t_6);
21985 10 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21986 10 : __pyx_t_9 = PyObject_IsInstance(__pyx_v_val, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error)
21987 10 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21988 10 : __pyx_t_8 = (!__pyx_t_9);
21989 10 : if (__pyx_t_8) {
21990 :
21991 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":175
21992 : * if val is not None:
21993 : * if not isinstance(val, numbers.Number):
21994 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
21995 : * else:
21996 : * opt_status = highs.setHighsOptionValueDbl(opt.encode(), val)
21997 : */
21998 0 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
21999 0 : __Pyx_GOTREF(__pyx_t_5);
22000 0 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 175, __pyx_L1_error)
22001 0 : __Pyx_GOTREF(__pyx_t_11);
22002 0 : __pyx_t_12 = NULL;
22003 0 : __pyx_t_13 = 0;
22004 : #if CYTHON_UNPACK_METHODS
22005 0 : if (likely(PyMethod_Check(__pyx_t_11))) {
22006 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
22007 0 : if (likely(__pyx_t_12)) {
22008 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
22009 0 : __Pyx_INCREF(__pyx_t_12);
22010 0 : __Pyx_INCREF(function);
22011 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
22012 : __pyx_t_13 = 1;
22013 : }
22014 : }
22015 : #endif
22016 0 : {
22017 0 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22018 0 : __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22019 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22020 0 : if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 175, __pyx_L1_error)
22021 0 : __Pyx_GOTREF(__pyx_t_10);
22022 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22023 : }
22024 0 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
22025 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22026 0 : __pyx_t_10 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 175, __pyx_L1_error)
22027 0 : __Pyx_GOTREF(__pyx_t_10);
22028 0 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 175, __pyx_L1_error)
22029 0 : __Pyx_GOTREF(__pyx_t_11);
22030 0 : __pyx_t_12 = NULL;
22031 0 : __pyx_t_13 = 0;
22032 : #if CYTHON_UNPACK_METHODS
22033 0 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
22034 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
22035 0 : if (likely(__pyx_t_12)) {
22036 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22037 0 : __Pyx_INCREF(__pyx_t_12);
22038 0 : __Pyx_INCREF(function);
22039 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22040 : __pyx_t_13 = 1;
22041 : }
22042 : }
22043 : #endif
22044 0 : {
22045 0 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11};
22046 0 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
22047 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22048 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22049 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22050 0 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
22051 0 : __Pyx_GOTREF(__pyx_t_6);
22052 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22053 : }
22054 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22055 :
22056 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":174
22057 : * val = options.get(opt, None)
22058 : * if val is not None:
22059 : * if not isinstance(val, numbers.Number): # <<<<<<<<<<<<<<
22060 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22061 : * else:
22062 : */
22063 0 : goto __pyx_L12;
22064 : }
22065 :
22066 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":177
22067 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22068 : * else:
22069 : * opt_status = highs.setHighsOptionValueDbl(opt.encode(), val) # <<<<<<<<<<<<<<
22070 : * if opt_status != HighsStatusOK:
22071 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22072 : */
22073 10 : /*else*/ {
22074 10 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
22075 10 : __Pyx_GOTREF(__pyx_t_5);
22076 10 : __pyx_t_11 = NULL;
22077 10 : __pyx_t_13 = 0;
22078 : #if CYTHON_UNPACK_METHODS
22079 10 : if (likely(PyMethod_Check(__pyx_t_5))) {
22080 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
22081 0 : if (likely(__pyx_t_11)) {
22082 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22083 0 : __Pyx_INCREF(__pyx_t_11);
22084 0 : __Pyx_INCREF(function);
22085 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22086 : __pyx_t_13 = 1;
22087 : }
22088 : }
22089 : #endif
22090 10 : {
22091 10 : PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
22092 10 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22093 10 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
22094 10 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
22095 10 : __Pyx_GOTREF(__pyx_t_6);
22096 10 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22097 : }
22098 10 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
22099 10 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22100 10 : __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
22101 10 : __pyx_v_opt_status = __pyx_v_highs.setOptionValue(__pyx_t_14, __pyx_t_15);
22102 :
22103 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":178
22104 : * else:
22105 : * opt_status = highs.setHighsOptionValueDbl(opt.encode(), val)
22106 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22107 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22108 : *
22109 : */
22110 10 : __pyx_t_8 = (__pyx_v_opt_status != HighsStatus::kOk);
22111 10 : if (__pyx_t_8) {
22112 :
22113 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":179
22114 : * opt_status = highs.setHighsOptionValueDbl(opt.encode(), val)
22115 : * if opt_status != HighsStatusOK:
22116 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
22117 : *
22118 : *
22119 : */
22120 8 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error)
22121 8 : __Pyx_GOTREF(__pyx_t_5);
22122 8 : __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error)
22123 8 : __Pyx_GOTREF(__pyx_t_10);
22124 8 : __pyx_t_12 = NULL;
22125 8 : __pyx_t_13 = 0;
22126 : #if CYTHON_UNPACK_METHODS
22127 8 : if (likely(PyMethod_Check(__pyx_t_10))) {
22128 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
22129 0 : if (likely(__pyx_t_12)) {
22130 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
22131 0 : __Pyx_INCREF(__pyx_t_12);
22132 0 : __Pyx_INCREF(function);
22133 0 : __Pyx_DECREF_SET(__pyx_t_10, function);
22134 : __pyx_t_13 = 1;
22135 : }
22136 : }
22137 : #endif
22138 8 : {
22139 8 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22140 8 : __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22141 8 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22142 8 : if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error)
22143 8 : __Pyx_GOTREF(__pyx_t_11);
22144 8 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22145 : }
22146 8 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
22147 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22148 8 : __pyx_t_11 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error)
22149 8 : __Pyx_GOTREF(__pyx_t_11);
22150 8 : __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error)
22151 8 : __Pyx_GOTREF(__pyx_t_10);
22152 8 : __pyx_t_12 = NULL;
22153 8 : __pyx_t_13 = 0;
22154 : #if CYTHON_UNPACK_METHODS
22155 8 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
22156 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
22157 0 : if (likely(__pyx_t_12)) {
22158 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22159 0 : __Pyx_INCREF(__pyx_t_12);
22160 0 : __Pyx_INCREF(function);
22161 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22162 : __pyx_t_13 = 1;
22163 : }
22164 : }
22165 : #endif
22166 8 : {
22167 8 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_10};
22168 8 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
22169 8 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22170 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22171 8 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22172 8 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
22173 8 : __Pyx_GOTREF(__pyx_t_6);
22174 8 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22175 : }
22176 8 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22177 :
22178 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":178
22179 : * else:
22180 : * opt_status = highs.setHighsOptionValueDbl(opt.encode(), val)
22181 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22182 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22183 : *
22184 : */
22185 : }
22186 : }
22187 2 : __pyx_L12:;
22188 :
22189 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":173
22190 : * ]):
22191 : * val = options.get(opt, None)
22192 : * if val is not None: # <<<<<<<<<<<<<<
22193 : * if not isinstance(val, numbers.Number):
22194 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22195 : */
22196 : }
22197 : }
22198 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22199 :
22200 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":183
22201 : *
22202 : * # Do all the strings
22203 : * for opt in set(['solver']): # <<<<<<<<<<<<<<
22204 : * val = options.get(opt, None)
22205 : * if val is not None:
22206 : */
22207 1001 : __pyx_t_2 = 0;
22208 1001 : __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
22209 1001 : __Pyx_GOTREF(__pyx_t_6);
22210 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_solver) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
22211 1001 : __pyx_t_5 = __Pyx_set_iterator(__pyx_t_6, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error)
22212 1001 : __Pyx_GOTREF(__pyx_t_5);
22213 1001 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22214 1001 : __Pyx_XDECREF(__pyx_t_1);
22215 1001 : __pyx_t_1 = __pyx_t_5;
22216 1001 : __pyx_t_5 = 0;
22217 2002 : while (1) {
22218 2002 : __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4);
22219 2002 : if (unlikely(__pyx_t_7 == 0)) break;
22220 1001 : if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 183, __pyx_L1_error)
22221 1001 : __Pyx_GOTREF(__pyx_t_5);
22222 1001 : __Pyx_XDECREF_SET(__pyx_v_opt, __pyx_t_5);
22223 1001 : __pyx_t_5 = 0;
22224 :
22225 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":184
22226 : * # Do all the strings
22227 : * for opt in set(['solver']):
22228 : * val = options.get(opt, None) # <<<<<<<<<<<<<<
22229 : * if val is not None:
22230 : * if not isinstance(val, str):
22231 : */
22232 1001 : if (unlikely(__pyx_v_options == Py_None)) {
22233 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22234 0 : __PYX_ERR(0, 184, __pyx_L1_error)
22235 : }
22236 1001 : __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_options, __pyx_v_opt, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
22237 1001 : __Pyx_GOTREF(__pyx_t_5);
22238 1001 : __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
22239 1001 : __pyx_t_5 = 0;
22240 :
22241 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":185
22242 : * for opt in set(['solver']):
22243 : * val = options.get(opt, None)
22244 : * if val is not None: # <<<<<<<<<<<<<<
22245 : * if not isinstance(val, str):
22246 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22247 : */
22248 1001 : __pyx_t_8 = (__pyx_v_val != Py_None);
22249 1001 : if (__pyx_t_8) {
22250 :
22251 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":186
22252 : * val = options.get(opt, None)
22253 : * if val is not None:
22254 : * if not isinstance(val, str): # <<<<<<<<<<<<<<
22255 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22256 : * else:
22257 : */
22258 710 : __pyx_t_8 = PyUnicode_Check(__pyx_v_val);
22259 710 : __pyx_t_9 = (!__pyx_t_8);
22260 710 : if (__pyx_t_9) {
22261 :
22262 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":187
22263 : * if val is not None:
22264 : * if not isinstance(val, str):
22265 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
22266 : * else:
22267 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val.encode())
22268 : */
22269 0 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
22270 0 : __Pyx_GOTREF(__pyx_t_6);
22271 0 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L1_error)
22272 0 : __Pyx_GOTREF(__pyx_t_11);
22273 0 : __pyx_t_12 = NULL;
22274 0 : __pyx_t_13 = 0;
22275 : #if CYTHON_UNPACK_METHODS
22276 0 : if (likely(PyMethod_Check(__pyx_t_11))) {
22277 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
22278 0 : if (likely(__pyx_t_12)) {
22279 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
22280 0 : __Pyx_INCREF(__pyx_t_12);
22281 0 : __Pyx_INCREF(function);
22282 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
22283 : __pyx_t_13 = 1;
22284 : }
22285 : }
22286 : #endif
22287 0 : {
22288 0 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22289 0 : __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22290 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22291 0 : if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 187, __pyx_L1_error)
22292 0 : __Pyx_GOTREF(__pyx_t_10);
22293 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22294 : }
22295 0 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
22296 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22297 0 : __pyx_t_10 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 187, __pyx_L1_error)
22298 0 : __Pyx_GOTREF(__pyx_t_10);
22299 0 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L1_error)
22300 0 : __Pyx_GOTREF(__pyx_t_11);
22301 0 : __pyx_t_12 = NULL;
22302 0 : __pyx_t_13 = 0;
22303 : #if CYTHON_UNPACK_METHODS
22304 0 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
22305 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
22306 0 : if (likely(__pyx_t_12)) {
22307 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22308 0 : __Pyx_INCREF(__pyx_t_12);
22309 0 : __Pyx_INCREF(function);
22310 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22311 : __pyx_t_13 = 1;
22312 : }
22313 : }
22314 : #endif
22315 0 : {
22316 0 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11};
22317 0 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
22318 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22319 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22320 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22321 0 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
22322 0 : __Pyx_GOTREF(__pyx_t_5);
22323 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22324 : }
22325 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22326 :
22327 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":186
22328 : * val = options.get(opt, None)
22329 : * if val is not None:
22330 : * if not isinstance(val, str): # <<<<<<<<<<<<<<
22331 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22332 : * else:
22333 : */
22334 0 : goto __pyx_L17;
22335 : }
22336 :
22337 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":189
22338 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22339 : * else:
22340 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val.encode()) # <<<<<<<<<<<<<<
22341 : * if opt_status != HighsStatusOK:
22342 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22343 : */
22344 710 : /*else*/ {
22345 710 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
22346 710 : __Pyx_GOTREF(__pyx_t_6);
22347 710 : __pyx_t_11 = NULL;
22348 710 : __pyx_t_13 = 0;
22349 : #if CYTHON_UNPACK_METHODS
22350 710 : if (likely(PyMethod_Check(__pyx_t_6))) {
22351 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
22352 0 : if (likely(__pyx_t_11)) {
22353 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22354 0 : __Pyx_INCREF(__pyx_t_11);
22355 0 : __Pyx_INCREF(function);
22356 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22357 : __pyx_t_13 = 1;
22358 : }
22359 : }
22360 : #endif
22361 710 : {
22362 710 : PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
22363 710 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22364 710 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
22365 710 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error)
22366 710 : __Pyx_GOTREF(__pyx_t_5);
22367 710 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22368 : }
22369 710 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
22370 710 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22371 710 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
22372 710 : __Pyx_GOTREF(__pyx_t_6);
22373 710 : __pyx_t_11 = NULL;
22374 710 : __pyx_t_13 = 0;
22375 : #if CYTHON_UNPACK_METHODS
22376 710 : if (likely(PyMethod_Check(__pyx_t_6))) {
22377 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
22378 0 : if (likely(__pyx_t_11)) {
22379 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22380 0 : __Pyx_INCREF(__pyx_t_11);
22381 0 : __Pyx_INCREF(function);
22382 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22383 : __pyx_t_13 = 1;
22384 : }
22385 : }
22386 : #endif
22387 710 : {
22388 710 : PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
22389 710 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22390 710 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
22391 710 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error)
22392 710 : __Pyx_GOTREF(__pyx_t_5);
22393 710 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22394 : }
22395 710 : __pyx_t_16 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
22396 710 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22397 710 : __pyx_v_opt_status = __pyx_v_highs.setOptionValue(__pyx_t_14, __pyx_t_16);
22398 :
22399 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":190
22400 : * else:
22401 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val.encode())
22402 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22403 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22404 : *
22405 : */
22406 710 : __pyx_t_9 = (__pyx_v_opt_status != HighsStatus::kOk);
22407 710 : if (__pyx_t_9) {
22408 :
22409 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":191
22410 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val.encode())
22411 : * if opt_status != HighsStatusOK:
22412 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
22413 : *
22414 : *
22415 : */
22416 0 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
22417 0 : __Pyx_GOTREF(__pyx_t_6);
22418 0 : __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error)
22419 0 : __Pyx_GOTREF(__pyx_t_10);
22420 0 : __pyx_t_12 = NULL;
22421 0 : __pyx_t_13 = 0;
22422 : #if CYTHON_UNPACK_METHODS
22423 0 : if (likely(PyMethod_Check(__pyx_t_10))) {
22424 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
22425 0 : if (likely(__pyx_t_12)) {
22426 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
22427 0 : __Pyx_INCREF(__pyx_t_12);
22428 0 : __Pyx_INCREF(function);
22429 0 : __Pyx_DECREF_SET(__pyx_t_10, function);
22430 : __pyx_t_13 = 1;
22431 : }
22432 : }
22433 : #endif
22434 0 : {
22435 0 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22436 0 : __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22437 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22438 0 : if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error)
22439 0 : __Pyx_GOTREF(__pyx_t_11);
22440 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22441 : }
22442 0 : __pyx_t_16 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
22443 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22444 0 : __pyx_t_11 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16), __pyx_v_val, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error)
22445 0 : __Pyx_GOTREF(__pyx_t_11);
22446 0 : __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error)
22447 0 : __Pyx_GOTREF(__pyx_t_10);
22448 0 : __pyx_t_12 = NULL;
22449 0 : __pyx_t_13 = 0;
22450 : #if CYTHON_UNPACK_METHODS
22451 0 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
22452 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
22453 0 : if (likely(__pyx_t_12)) {
22454 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22455 0 : __Pyx_INCREF(__pyx_t_12);
22456 0 : __Pyx_INCREF(function);
22457 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22458 : __pyx_t_13 = 1;
22459 : }
22460 : }
22461 : #endif
22462 0 : {
22463 0 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_10};
22464 0 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
22465 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22466 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22467 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22468 0 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error)
22469 0 : __Pyx_GOTREF(__pyx_t_5);
22470 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22471 : }
22472 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22473 :
22474 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":190
22475 : * else:
22476 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val.encode())
22477 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22478 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22479 : *
22480 : */
22481 : }
22482 : }
22483 710 : __pyx_L17:;
22484 :
22485 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":185
22486 : * for opt in set(['solver']):
22487 : * val = options.get(opt, None)
22488 : * if val is not None: # <<<<<<<<<<<<<<
22489 : * if not isinstance(val, str):
22490 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22491 : */
22492 : }
22493 : }
22494 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22495 :
22496 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":195
22497 : *
22498 : * # Do all the bool to strings
22499 : * for opt in set([ # <<<<<<<<<<<<<<
22500 : * 'parallel',
22501 : * 'presolve',
22502 : */
22503 1001 : __pyx_t_3 = 0;
22504 1001 : __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L1_error)
22505 1001 : __Pyx_GOTREF(__pyx_t_5);
22506 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_parallel) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
22507 1001 : if (PySet_Add(__pyx_t_5, __pyx_n_u_presolve) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
22508 1001 : __pyx_t_6 = __Pyx_set_iterator(__pyx_t_5, 1, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
22509 1001 : __Pyx_GOTREF(__pyx_t_6);
22510 1001 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22511 1001 : __Pyx_XDECREF(__pyx_t_1);
22512 1001 : __pyx_t_1 = __pyx_t_6;
22513 1001 : __pyx_t_6 = 0;
22514 3003 : while (1) {
22515 3003 : __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_6, __pyx_t_4);
22516 3003 : if (unlikely(__pyx_t_7 == 0)) break;
22517 2002 : if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
22518 2002 : __Pyx_GOTREF(__pyx_t_6);
22519 2002 : __Pyx_XDECREF_SET(__pyx_v_opt, __pyx_t_6);
22520 2002 : __pyx_t_6 = 0;
22521 :
22522 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":199
22523 : * 'presolve',
22524 : * ]):
22525 : * val = options.get(opt, None) # <<<<<<<<<<<<<<
22526 : * if val is not None:
22527 : * if isinstance(val, bool):
22528 : */
22529 2002 : if (unlikely(__pyx_v_options == Py_None)) {
22530 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22531 0 : __PYX_ERR(0, 199, __pyx_L1_error)
22532 : }
22533 2002 : __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_options, __pyx_v_opt, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error)
22534 2002 : __Pyx_GOTREF(__pyx_t_6);
22535 2002 : __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
22536 2002 : __pyx_t_6 = 0;
22537 :
22538 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":200
22539 : * ]):
22540 : * val = options.get(opt, None)
22541 : * if val is not None: # <<<<<<<<<<<<<<
22542 : * if isinstance(val, bool):
22543 : * if val:
22544 : */
22545 2002 : __pyx_t_9 = (__pyx_v_val != Py_None);
22546 2002 : if (__pyx_t_9) {
22547 :
22548 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":201
22549 : * val = options.get(opt, None)
22550 : * if val is not None:
22551 : * if isinstance(val, bool): # <<<<<<<<<<<<<<
22552 : * if val:
22553 : * val0 = b'on'
22554 : */
22555 753 : __pyx_t_6 = ((PyObject*)&PyBool_Type);
22556 753 : __Pyx_INCREF(__pyx_t_6);
22557 753 : __pyx_t_9 = PyObject_IsInstance(__pyx_v_val, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 201, __pyx_L1_error)
22558 753 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22559 753 : if (__pyx_t_9) {
22560 :
22561 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":202
22562 : * if val is not None:
22563 : * if isinstance(val, bool):
22564 : * if val: # <<<<<<<<<<<<<<
22565 : * val0 = b'on'
22566 : * else:
22567 : */
22568 751 : __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 202, __pyx_L1_error)
22569 751 : if (__pyx_t_9) {
22570 :
22571 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":203
22572 : * if isinstance(val, bool):
22573 : * if val:
22574 : * val0 = b'on' # <<<<<<<<<<<<<<
22575 : * else:
22576 : * val0 = b'off'
22577 : */
22578 745 : __Pyx_INCREF(__pyx_n_b_on);
22579 745 : __Pyx_XDECREF_SET(__pyx_v_val0, __pyx_n_b_on);
22580 :
22581 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":202
22582 : * if val is not None:
22583 : * if isinstance(val, bool):
22584 : * if val: # <<<<<<<<<<<<<<
22585 : * val0 = b'on'
22586 : * else:
22587 : */
22588 745 : goto __pyx_L23;
22589 : }
22590 :
22591 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":205
22592 : * val0 = b'on'
22593 : * else:
22594 : * val0 = b'off' # <<<<<<<<<<<<<<
22595 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val0)
22596 : * if opt_status != HighsStatusOK:
22597 : */
22598 6 : /*else*/ {
22599 6 : __Pyx_INCREF(__pyx_n_b_off);
22600 6 : __Pyx_XDECREF_SET(__pyx_v_val0, __pyx_n_b_off);
22601 : }
22602 751 : __pyx_L23:;
22603 :
22604 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":206
22605 : * else:
22606 : * val0 = b'off'
22607 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val0) # <<<<<<<<<<<<<<
22608 : * if opt_status != HighsStatusOK:
22609 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning)
22610 : */
22611 751 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
22612 751 : __Pyx_GOTREF(__pyx_t_5);
22613 751 : __pyx_t_10 = NULL;
22614 751 : __pyx_t_13 = 0;
22615 : #if CYTHON_UNPACK_METHODS
22616 751 : if (likely(PyMethod_Check(__pyx_t_5))) {
22617 0 : __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
22618 0 : if (likely(__pyx_t_10)) {
22619 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22620 0 : __Pyx_INCREF(__pyx_t_10);
22621 0 : __Pyx_INCREF(function);
22622 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22623 : __pyx_t_13 = 1;
22624 : }
22625 : }
22626 : #endif
22627 751 : {
22628 751 : PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
22629 751 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22630 751 : __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22631 751 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
22632 751 : __Pyx_GOTREF(__pyx_t_6);
22633 751 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22634 : }
22635 751 : __pyx_t_16 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
22636 751 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22637 751 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_val0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
22638 751 : __pyx_v_opt_status = __pyx_v_highs.setOptionValue(__pyx_t_16, __pyx_t_14);
22639 :
22640 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":207
22641 : * val0 = b'off'
22642 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val0)
22643 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22644 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning)
22645 : * else:
22646 : */
22647 751 : __pyx_t_9 = (__pyx_v_opt_status != HighsStatus::kOk);
22648 751 : if (__pyx_t_9) {
22649 :
22650 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":208
22651 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val0)
22652 : * if opt_status != HighsStatusOK:
22653 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning) # <<<<<<<<<<<<<<
22654 : * else:
22655 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning)
22656 : */
22657 0 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error)
22658 0 : __Pyx_GOTREF(__pyx_t_5);
22659 0 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 208, __pyx_L1_error)
22660 0 : __Pyx_GOTREF(__pyx_t_11);
22661 0 : __pyx_t_12 = NULL;
22662 0 : __pyx_t_13 = 0;
22663 : #if CYTHON_UNPACK_METHODS
22664 0 : if (likely(PyMethod_Check(__pyx_t_11))) {
22665 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
22666 0 : if (likely(__pyx_t_12)) {
22667 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
22668 0 : __Pyx_INCREF(__pyx_t_12);
22669 0 : __Pyx_INCREF(function);
22670 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
22671 : __pyx_t_13 = 1;
22672 : }
22673 : }
22674 : #endif
22675 0 : {
22676 0 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22677 0 : __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22678 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22679 0 : if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 208, __pyx_L1_error)
22680 0 : __Pyx_GOTREF(__pyx_t_10);
22681 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22682 : }
22683 0 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
22684 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22685 0 : __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 208, __pyx_L1_error)
22686 0 : __Pyx_GOTREF(__pyx_t_10);
22687 0 : __Pyx_INCREF(Py_True);
22688 0 : __Pyx_GIVEREF(Py_True);
22689 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, Py_True)) __PYX_ERR(0, 208, __pyx_L1_error);
22690 0 : __Pyx_INCREF(Py_False);
22691 0 : __Pyx_GIVEREF(Py_False);
22692 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, Py_False)) __PYX_ERR(0, 208, __pyx_L1_error);
22693 0 : __pyx_t_17.__pyx_n = 1;
22694 0 : __pyx_t_17.valid_set = __pyx_t_10;
22695 0 : __pyx_t_11 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, &__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 208, __pyx_L1_error)
22696 0 : __Pyx_GOTREF(__pyx_t_11);
22697 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22698 0 : __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 208, __pyx_L1_error)
22699 0 : __Pyx_GOTREF(__pyx_t_10);
22700 0 : __pyx_t_12 = NULL;
22701 0 : __pyx_t_13 = 0;
22702 : #if CYTHON_UNPACK_METHODS
22703 0 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
22704 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
22705 0 : if (likely(__pyx_t_12)) {
22706 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22707 0 : __Pyx_INCREF(__pyx_t_12);
22708 0 : __Pyx_INCREF(function);
22709 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22710 : __pyx_t_13 = 1;
22711 : }
22712 : }
22713 : #endif
22714 0 : {
22715 0 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_10};
22716 0 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
22717 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22718 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22719 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22720 0 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
22721 0 : __Pyx_GOTREF(__pyx_t_6);
22722 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22723 : }
22724 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22725 :
22726 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":207
22727 : * val0 = b'off'
22728 : * opt_status = highs.setHighsOptionValueStr(opt.encode(), val0)
22729 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22730 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning)
22731 : * else:
22732 : */
22733 : }
22734 :
22735 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":201
22736 : * val = options.get(opt, None)
22737 : * if val is not None:
22738 : * if isinstance(val, bool): # <<<<<<<<<<<<<<
22739 : * if val:
22740 : * val0 = b'on'
22741 : */
22742 751 : goto __pyx_L22;
22743 : }
22744 :
22745 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":210
22746 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning)
22747 : * else:
22748 : * warn(_opt_warning(opt.encode(), val, valid_set=[True, False]), OptimizeWarning) # <<<<<<<<<<<<<<
22749 : *
22750 : *
22751 : */
22752 2 : /*else*/ {
22753 2 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
22754 2 : __Pyx_GOTREF(__pyx_t_5);
22755 2 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L1_error)
22756 2 : __Pyx_GOTREF(__pyx_t_11);
22757 2 : __pyx_t_12 = NULL;
22758 2 : __pyx_t_13 = 0;
22759 : #if CYTHON_UNPACK_METHODS
22760 2 : if (likely(PyMethod_Check(__pyx_t_11))) {
22761 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
22762 0 : if (likely(__pyx_t_12)) {
22763 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
22764 0 : __Pyx_INCREF(__pyx_t_12);
22765 0 : __Pyx_INCREF(function);
22766 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
22767 : __pyx_t_13 = 1;
22768 : }
22769 : }
22770 : #endif
22771 2 : {
22772 2 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22773 2 : __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22774 2 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22775 2 : if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L1_error)
22776 2 : __Pyx_GOTREF(__pyx_t_10);
22777 2 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22778 : }
22779 2 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error)
22780 2 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22781 2 : __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L1_error)
22782 2 : __Pyx_GOTREF(__pyx_t_10);
22783 2 : __Pyx_INCREF(Py_True);
22784 2 : __Pyx_GIVEREF(Py_True);
22785 2 : if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, Py_True)) __PYX_ERR(0, 210, __pyx_L1_error);
22786 2 : __Pyx_INCREF(Py_False);
22787 2 : __Pyx_GIVEREF(Py_False);
22788 2 : if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, Py_False)) __PYX_ERR(0, 210, __pyx_L1_error);
22789 2 : __pyx_t_17.__pyx_n = 1;
22790 2 : __pyx_t_17.valid_set = __pyx_t_10;
22791 2 : __pyx_t_11 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, &__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L1_error)
22792 2 : __Pyx_GOTREF(__pyx_t_11);
22793 2 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22794 2 : __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L1_error)
22795 2 : __Pyx_GOTREF(__pyx_t_10);
22796 2 : __pyx_t_12 = NULL;
22797 2 : __pyx_t_13 = 0;
22798 : #if CYTHON_UNPACK_METHODS
22799 2 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
22800 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
22801 0 : if (likely(__pyx_t_12)) {
22802 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22803 0 : __Pyx_INCREF(__pyx_t_12);
22804 0 : __Pyx_INCREF(function);
22805 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22806 : __pyx_t_13 = 1;
22807 : }
22808 : }
22809 : #endif
22810 2 : {
22811 2 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_10};
22812 2 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
22813 2 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22814 2 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22815 2 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22816 2 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
22817 2 : __Pyx_GOTREF(__pyx_t_6);
22818 2 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22819 : }
22820 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22821 : }
22822 : __pyx_L22:;
22823 :
22824 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":200
22825 : * ]):
22826 : * val = options.get(opt, None)
22827 : * if val is not None: # <<<<<<<<<<<<<<
22828 : * if isinstance(val, bool):
22829 : * if val:
22830 : */
22831 : }
22832 : }
22833 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22834 :
22835 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":214
22836 : *
22837 : * # Do the actual bools
22838 : * for opt in set([ # <<<<<<<<<<<<<<
22839 : * 'less_infeasible_DSE_check',
22840 : * 'less_infeasible_DSE_choose_row',
22841 : */
22842 1001 : __pyx_t_2 = 0;
22843 1001 : __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
22844 1001 : __Pyx_GOTREF(__pyx_t_6);
22845 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_less_infeasible_DSE_check) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22846 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_less_infeasible_DSE_choose_row) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22847 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_log_to_console) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22848 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_mps_parser_type_free) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22849 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_output_flag) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22850 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_run_as_hsol) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22851 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_run_crossover) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22852 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_simplex_initial_condition_check) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22853 1001 : if (PySet_Add(__pyx_t_6, __pyx_n_u_use_original_HFactor_logic) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
22854 1001 : __pyx_t_5 = __Pyx_set_iterator(__pyx_t_6, 1, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
22855 1001 : __Pyx_GOTREF(__pyx_t_5);
22856 1001 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22857 1001 : __Pyx_XDECREF(__pyx_t_1);
22858 1001 : __pyx_t_1 = __pyx_t_5;
22859 1001 : __pyx_t_5 = 0;
22860 10010 : while (1) {
22861 10010 : __pyx_t_7 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, __pyx_t_4);
22862 10010 : if (unlikely(__pyx_t_7 == 0)) break;
22863 9009 : if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 214, __pyx_L1_error)
22864 9009 : __Pyx_GOTREF(__pyx_t_5);
22865 9009 : __Pyx_XDECREF_SET(__pyx_v_opt, __pyx_t_5);
22866 9009 : __pyx_t_5 = 0;
22867 :
22868 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":225
22869 : * 'use_original_HFactor_logic',
22870 : * ]):
22871 : * val = options.get(opt, None) # <<<<<<<<<<<<<<
22872 : * if val is not None:
22873 : * if val in [True, False]:
22874 : */
22875 9009 : if (unlikely(__pyx_v_options == Py_None)) {
22876 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22877 0 : __PYX_ERR(0, 225, __pyx_L1_error)
22878 : }
22879 9009 : __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_options, __pyx_v_opt, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
22880 9009 : __Pyx_GOTREF(__pyx_t_5);
22881 9009 : __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
22882 9009 : __pyx_t_5 = 0;
22883 :
22884 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":226
22885 : * ]):
22886 : * val = options.get(opt, None)
22887 : * if val is not None: # <<<<<<<<<<<<<<
22888 : * if val in [True, False]:
22889 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
22890 : */
22891 9009 : __pyx_t_9 = (__pyx_v_val != Py_None);
22892 9009 : if (__pyx_t_9) {
22893 :
22894 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":227
22895 : * val = options.get(opt, None)
22896 : * if val is not None:
22897 : * if val in [True, False]: # <<<<<<<<<<<<<<
22898 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
22899 : * if opt_status != HighsStatusOK:
22900 : */
22901 1754 : __Pyx_INCREF(__pyx_v_val);
22902 1754 : __pyx_t_5 = __pyx_v_val;
22903 1754 : __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error)
22904 1754 : __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 227, __pyx_L1_error)
22905 1754 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22906 1754 : if (!__pyx_t_8) {
22907 : } else {
22908 8 : __pyx_t_9 = __pyx_t_8;
22909 8 : goto __pyx_L29_bool_binop_done;
22910 : }
22911 1746 : __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error)
22912 1746 : __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 227, __pyx_L1_error)
22913 1746 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22914 1746 : __pyx_t_9 = __pyx_t_8;
22915 1754 : __pyx_L29_bool_binop_done:;
22916 1754 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22917 1754 : __pyx_t_8 = __pyx_t_9;
22918 1754 : if (__pyx_t_8) {
22919 :
22920 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":228
22921 : * if val is not None:
22922 : * if val in [True, False]:
22923 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val) # <<<<<<<<<<<<<<
22924 : * if opt_status != HighsStatusOK:
22925 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22926 : */
22927 1750 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
22928 1750 : __Pyx_GOTREF(__pyx_t_6);
22929 1750 : __pyx_t_10 = NULL;
22930 1750 : __pyx_t_13 = 0;
22931 : #if CYTHON_UNPACK_METHODS
22932 1750 : if (likely(PyMethod_Check(__pyx_t_6))) {
22933 0 : __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
22934 0 : if (likely(__pyx_t_10)) {
22935 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22936 0 : __Pyx_INCREF(__pyx_t_10);
22937 0 : __Pyx_INCREF(function);
22938 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22939 : __pyx_t_13 = 1;
22940 : }
22941 : }
22942 : #endif
22943 1750 : {
22944 1750 : PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
22945 1750 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22946 1750 : __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22947 1750 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
22948 1750 : __Pyx_GOTREF(__pyx_t_5);
22949 1750 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22950 : }
22951 1750 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
22952 1750 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22953 1750 : __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_18 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
22954 1750 : __pyx_v_opt_status = __pyx_v_highs.setOptionValue(__pyx_t_14, __pyx_t_18);
22955 :
22956 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":229
22957 : * if val in [True, False]:
22958 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
22959 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
22960 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22961 : * else:
22962 : */
22963 1750 : __pyx_t_8 = (__pyx_v_opt_status != HighsStatus::kOk);
22964 1750 : if (__pyx_t_8) {
22965 :
22966 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":230
22967 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
22968 : * if opt_status != HighsStatusOK:
22969 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
22970 : * else:
22971 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
22972 : */
22973 0 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error)
22974 0 : __Pyx_GOTREF(__pyx_t_6);
22975 0 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L1_error)
22976 0 : __Pyx_GOTREF(__pyx_t_11);
22977 0 : __pyx_t_12 = NULL;
22978 0 : __pyx_t_13 = 0;
22979 : #if CYTHON_UNPACK_METHODS
22980 0 : if (likely(PyMethod_Check(__pyx_t_11))) {
22981 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
22982 0 : if (likely(__pyx_t_12)) {
22983 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
22984 0 : __Pyx_INCREF(__pyx_t_12);
22985 0 : __Pyx_INCREF(function);
22986 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
22987 : __pyx_t_13 = 1;
22988 : }
22989 : }
22990 : #endif
22991 0 : {
22992 0 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
22993 0 : __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
22994 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22995 0 : if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error)
22996 0 : __Pyx_GOTREF(__pyx_t_10);
22997 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22998 : }
22999 0 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
23000 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23001 0 : __pyx_t_10 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error)
23002 0 : __Pyx_GOTREF(__pyx_t_10);
23003 0 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L1_error)
23004 0 : __Pyx_GOTREF(__pyx_t_11);
23005 0 : __pyx_t_12 = NULL;
23006 0 : __pyx_t_13 = 0;
23007 : #if CYTHON_UNPACK_METHODS
23008 0 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
23009 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
23010 0 : if (likely(__pyx_t_12)) {
23011 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
23012 0 : __Pyx_INCREF(__pyx_t_12);
23013 0 : __Pyx_INCREF(function);
23014 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
23015 : __pyx_t_13 = 1;
23016 : }
23017 : }
23018 : #endif
23019 0 : {
23020 0 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11};
23021 0 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
23022 0 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
23023 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23024 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23025 0 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error)
23026 0 : __Pyx_GOTREF(__pyx_t_5);
23027 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23028 : }
23029 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23030 :
23031 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":229
23032 : * if val in [True, False]:
23033 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
23034 : * if opt_status != HighsStatusOK: # <<<<<<<<<<<<<<
23035 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
23036 : * else:
23037 : */
23038 : }
23039 :
23040 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":227
23041 : * val = options.get(opt, None)
23042 : * if val is not None:
23043 : * if val in [True, False]: # <<<<<<<<<<<<<<
23044 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
23045 : * if opt_status != HighsStatusOK:
23046 : */
23047 1750 : goto __pyx_L28;
23048 : }
23049 :
23050 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":232
23051 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning)
23052 : * else:
23053 : * warn(_opt_warning(opt.encode(), val), OptimizeWarning) # <<<<<<<<<<<<<<
23054 : *
23055 : *
23056 : */
23057 4 : /*else*/ {
23058 4 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
23059 4 : __Pyx_GOTREF(__pyx_t_6);
23060 4 : __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 232, __pyx_L1_error)
23061 4 : __Pyx_GOTREF(__pyx_t_10);
23062 4 : __pyx_t_12 = NULL;
23063 4 : __pyx_t_13 = 0;
23064 : #if CYTHON_UNPACK_METHODS
23065 4 : if (likely(PyMethod_Check(__pyx_t_10))) {
23066 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
23067 0 : if (likely(__pyx_t_12)) {
23068 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
23069 0 : __Pyx_INCREF(__pyx_t_12);
23070 0 : __Pyx_INCREF(function);
23071 0 : __Pyx_DECREF_SET(__pyx_t_10, function);
23072 : __pyx_t_13 = 1;
23073 : }
23074 : }
23075 : #endif
23076 4 : {
23077 4 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
23078 4 : __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
23079 4 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
23080 4 : if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 232, __pyx_L1_error)
23081 4 : __Pyx_GOTREF(__pyx_t_11);
23082 4 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23083 : }
23084 4 : __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
23085 4 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23086 4 : __pyx_t_11 = __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__opt_warning(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __pyx_v_val, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 232, __pyx_L1_error)
23087 4 : __Pyx_GOTREF(__pyx_t_11);
23088 4 : __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 232, __pyx_L1_error)
23089 4 : __Pyx_GOTREF(__pyx_t_10);
23090 4 : __pyx_t_12 = NULL;
23091 4 : __pyx_t_13 = 0;
23092 : #if CYTHON_UNPACK_METHODS
23093 4 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
23094 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
23095 0 : if (likely(__pyx_t_12)) {
23096 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
23097 0 : __Pyx_INCREF(__pyx_t_12);
23098 0 : __Pyx_INCREF(function);
23099 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
23100 : __pyx_t_13 = 1;
23101 : }
23102 : }
23103 : #endif
23104 4 : {
23105 4 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_10};
23106 4 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
23107 4 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
23108 4 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23109 4 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23110 4 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error)
23111 4 : __Pyx_GOTREF(__pyx_t_5);
23112 4 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23113 : }
23114 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23115 : }
23116 : __pyx_L28:;
23117 :
23118 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":226
23119 : * ]):
23120 : * val = options.get(opt, None)
23121 : * if val is not None: # <<<<<<<<<<<<<<
23122 : * if val in [True, False]:
23123 : * opt_status = highs.setHighsOptionValueBool(opt.encode(), val)
23124 : */
23125 : }
23126 : }
23127 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23128 :
23129 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":115
23130 : * 'Using default.' % (name.decode(), str(val)))
23131 : *
23132 : * cdef void apply_options(dict options, Highs & highs): # <<<<<<<<<<<<<<
23133 : * '''Take options from dictionary and apply to HiGHS object.'''
23134 : *
23135 : */
23136 :
23137 : /* function exit code */
23138 1001 : goto __pyx_L0;
23139 0 : __pyx_L1_error:;
23140 0 : __Pyx_XDECREF(__pyx_t_1);
23141 0 : __Pyx_XDECREF(__pyx_t_5);
23142 0 : __Pyx_XDECREF(__pyx_t_6);
23143 0 : __Pyx_XDECREF(__pyx_t_10);
23144 0 : __Pyx_XDECREF(__pyx_t_11);
23145 0 : __Pyx_XDECREF(__pyx_t_12);
23146 0 : __Pyx_AddTraceback("scipy.optimize._highs.cython.src._highs_wrapper.apply_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
23147 1001 : __pyx_L0:;
23148 1001 : __Pyx_XDECREF(__pyx_v_opt);
23149 1001 : __Pyx_XDECREF(__pyx_v_val);
23150 1001 : __Pyx_XDECREF(__pyx_v_val0);
23151 1001 : __Pyx_RefNannyFinishContext();
23152 1001 : }
23153 :
23154 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":238
23155 : *
23156 : *
23157 : * def _highs_wrapper( # <<<<<<<<<<<<<<
23158 : * double[::1] c,
23159 : * int[::1] astart,
23160 : */
23161 :
23162 : /* Python wrapper */
23163 : static PyObject *__pyx_pw_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_1_highs_wrapper(PyObject *__pyx_self,
23164 : #if CYTHON_METH_FASTCALL
23165 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23166 : #else
23167 : PyObject *__pyx_args, PyObject *__pyx_kwds
23168 : #endif
23169 : ); /*proto*/
23170 : PyDoc_STRVAR(__pyx_doc_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__highs_wrapper, "Solve linear programs using HiGHS [1]_.\n\n Assume problems of the form:\n\n MIN c.T @ x\n s.t. lhs <= A @ x <= rhs\n lb <= x <= ub\n\n Parameters\n ----------\n c : 1-D array, (n,)\n Array of objective value coefficients.\n astart : 1-D array\n CSC format index array.\n aindex : 1-D array\n CSC format index array.\n avalue : 1-D array\n Data array of the matrix.\n lhs : 1-D array (or None), (m,)\n Array of left hand side values of the inequality constraints.\n If ``lhs=None``, then an array of ``-inf`` is assumed.\n rhs : 1-D array, (m,)\n Array of right hand side values of the inequality constraints.\n lb : 1-D array (or None), (n,)\n Lower bounds on solution variables x. If ``lb=None``, then an\n array of all `0` is assumed.\n ub : 1-D array (or None), (n,)\n Upper bounds on solution variables x. If ``ub=None``, then an\n array of ``inf`` is assumed.\n options : dict\n A dictionary of solver options with the following fields:\n\n - allowed_simplex_cost_scale_factor : int\n Undocumented advanced option.\n\n - allowed_simplex_matrix_scale_factor : int\n Undocumented advanced option.\n\n - dual_feasibility_tolerance : double\n Dual feasibility tolerance for simplex.\n ``min(dual_feasibility_tolerance,\n primal_feasibility_tolerance)`` will be used for\n ipm feasibility tolerance.\n\n - dual_objective_value_upper_bound : double\n Upper bound on objective value for dual simplex:\n algorithm terminates if reached\n\n - dual_simplex_cleanup_strategy : int\n Undocumented advanced option.\n\n - dual_simplex_cost_perturbation_multiplier : double\n Undocumented advanced option.\n\n - dual_steepest_edge_wei""ght_log_error_threshhold : double\n Undocumented advanced option.\n\n - infinite_bound : double\n Limit on abs(constraint bound): values larger than\n this will be treated as infinite\n\n - infinite_cost : double\n Limit on cost coefficient: values larger than this\n will be treated as infinite.\n\n - ipm_iteration_limit : int\n Iteration limit for interior-point solver.\n\n - ipm_optimality_tolerance : double\n Optimality tolerance for IPM.\n\n - keep_n_rows : int {-1, 0, 1}\n Undocumented advanced option.\n\n - ``-1``: ``KEEP_N_ROWS_DELETE_ROWS``\n - ``0``: ``KEEP_N_ROWS_DELETE_ENTRIES``\n - ``1``: ``KEEP_N_ROWS_KEEP_ROWS``\n\n - large_matrix_value : double\n Upper limit on abs(matrix entries): values larger than\n this will be treated as infinite\n\n - less_infeasible_DSE_check : bool\n Undocumented advanced option.\n\n - less_infeasible_DSE_choose_row : bool\n Undocumented advanced option.\n\n - threads : int\n Maximum number of threads in parallel execution.\n\n - message_level : int {0, 1, 2, 4, 7}\n Verbosity level, corresponds to:\n\n - ``0``: ``ML_NONE``\n All messaging to stdout is suppressed.\n\n - ``1``: ``ML_VERBOSE``\n Includes a once-per-iteration report on simplex/ipm\n progress and information about each nonzero row and\n column.\n\n - ``2``: ``ML_DETAILED``\n Includes technical information about progress and\n events in applying the simplex method.\n\n - ``4``: ``ML_MI""NIMAL``\n Once-per-solve information about progress as well as a\n once-per-basis-matrix-reinversion report on progress in\n simplex or a once-per-iteration report on progress in IPX.\n\n ``message_level`` behaves like a bitmask, i.e., any\n combination of levels is possible using the bit-or\n operator.\n\n - mps_parser_type_free : bool\n Use free format MPS parsing.\n\n - parallel : bool\n Run the solver in serial (False) or parallel (True).\n\n - presolve : bool\n Run the presolve or not (or if ``None``, then choose).\n\n - primal_feasibility_tolerance : double\n Primal feasibility tolerance.\n ``min(dual_feasibility_tolerance,\n primal_feasibility_tolerance)`` will be used for\n ipm feasibility tolerance.\n\n - run_as_hsol : bool\n Undocumented advanced option.\n\n - run_crossover : bool\n Advanced option. Toggles running the crossover routine\n for IPX.\n\n - sense : int {1, -1}\n ``sense=1`` corresponds to the MIN problem, ``sense=-1``\n corresponds to the MAX problem. TODO: NOT IMPLEMENTED\n\n - simplex_crash_strategy : int {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}\n Strategy for simplex crash: off / LTSSF / Bixby (0/1/2).\n Default is ``0``. Corresponds to the following:\n\n - ``0``: ``SIMPLEX_CRASH_STRATEGY_OFF``\n - ``1``: ``SIMPLEX_CRASH_STRATEGY_LTSSF_K``\n - ``2``: ``SIMPLEX_CRASH_STRATEGY_BIXBY``\n - ``3``: ``SIMPLEX_CRASH_STRATEGY_LTSSF_PRI``\n - ``4``: ``SIMPLEX_CRASH_STRATEGY_LTSF_K``\n - ``5``: ``SIMPLEX_CRASH_STRATEGY_LTSF_PRI``\n "" - ``6``: ``SIMPLEX_CRASH_STRATEGY_LTSF``\n - ``7``: ``SIMPLEX_CRASH_STRATEGY_BIXBY_NO_NONZERO_COL_COSTS``\n - ``8``: ``SIMPLEX_CRASH_STRATEGY_BASIC``\n - ``9``: ``SIMPLE_CRASH_STRATEGY_TEST_SING``\n\n - simplex_dualise_strategy : int\n Undocumented advanced option.\n\n - simplex_dual_edge_weight_strategy : int {0, 1, 2, 3, 4}\n Strategy for simplex dual edge weights:\n Dantzig / Devex / Steepest Edge. Corresponds\n to the following:\n\n - ``0``: ``SIMPLEX_DUAL_EDGE_WEIGHT_STRATEGY_DANTZIG``\n - ``1``: ``SIMPLEX_DUAL_EDGE_WEIGHT_STRATEGY_DEVEX``\n - ``2``: ``SIMPLEX_DUAL_EDGE_WEIGHT_STRATEGY_STEEPEST_EDGE_TO_DEVEX_SWITCH``\n - ``3``: ``SIMPLEX_DUAL_EDGE_WEIGHT_STRATEGY_STEEPEST_EDGE``\n - ``4``: ``SIMPLEX_DUAL_EDGE_WEIGHT_STRATEGY_STEEPEST_EDGE_UNIT_INITIAL``\n\n - simplex_initial_condition_check : bool\n Undocumented advanced option.\n\n - simplex_initial_condition_tolerance : double\n Undocumented advanced option.\n\n - simplex_iteration_limit : int\n Iteration limit for simplex solver.\n\n - simplex_permute_strategy : int\n Undocumented advanced option.\n\n - simplex_price_strategy : int\n Undocumented advanced option.\n\n - simplex_primal_edge_weight_strategy : int {0, 1}\n Strategy for simplex primal edge weights:\n Dantzig / Devex. Corresponds to the following:\n\n - ``0``: ``SIMPLEX_PRIMAL_EDGE_WEIGHT_STRATEGY_DANTZIG``\n - ``1``: ``SIMPLEX_PRIMAL_EDGE_WEIGHT_STRATEGY_DEVEX``\n\n - simplex_scale_strategy : int {0, 1, 2, 3, 4, 5}\n Strategy for scaling before simplex solver:\n ""off / on (0/1)\n\n - ``0``: ``SIMPLEX_SCALE_STRATEGY_OFF``\n - ``1``: ``SIMPLEX_SCALE_STRATEGY_HIGHS``\n - ``2``: ``SIMPLEX_SCALE_STRATEGY_HIGHS_FORCED``\n - ``3``: ``SIMPLEX_SCALE_STRATEGY_HIGHS_015``\n - ``4``: ``SIMPLEX_SCALE_STRATEGY_HIGHS_0157``\n - ``5``: ``SIMPLEX_SCALE_STRATEGY_HSOL``\n\n - simplex_strategy : int {0, 1, 2, 3, 4}\n Strategy for simplex solver. Default: 1. Corresponds\n to the following:\n\n - ``0``: ``SIMPLEX_STRATEGY_MIN``\n - ``1``: ``SIMPLEX_STRATEGY_DUAL``\n - ``2``: ``SIMPLEX_STRATEGY_DUAL_TASKS``\n - ``3``: ``SIMPLEX_STRATEGY_DUAL_MULTI``\n - ``4``: ``SIMPLEX_STRATEGY_PRIMAL``\n\n - simplex_update_limit : int\n Limit on the number of simplex UPDATE operations.\n\n - small_matrix_value : double\n Lower limit on abs(matrix entries): values smaller\n than this will be treated as zero.\n\n - solution_file : str\n Solution file\n\n - solver : str {'simplex', 'ipm'}\n Choose which solver to use. If ``solver='simplex'``\n and ``parallel=True`` then PAMI will be used.\n\n - start_crossover_tolerance : double\n Tolerance to be satisfied before IPM crossover will\n start.\n\n - time_limit : double\n Max number of seconds to run the solver for.\n\n - use_original_HFactor_logic : bool\n Undocumented advanced option.\n\n - write_solution_to_file : bool\n Write the primal and dual solution to a file\n\n - write_solution_pretty : bool\n Write the primal and dual solution in a pretty\n (human-readable) format\n\n "" See [2]_ for a list of all non-advanced options.\n\n Returns\n -------\n res : dict\n\n If model_status is one of OPTIMAL,\n REACHED_DUAL_OBJECTIVE_VALUE_UPPER_BOUND, REACHED_TIME_LIMIT,\n REACHED_ITERATION_LIMIT:\n\n - ``status`` : int\n Model status code.\n\n - ``message`` : str\n Message corresponding to model status code.\n\n - ``x`` : list\n Solution variables.\n\n - ``slack`` : list\n Slack variables.\n\n - ``lambda`` : list\n Lagrange multipliers associated with the constraints\n Ax = b.\n\n - ``s`` : list\n Lagrange multipliers associated with the constraints\n x >= 0.\n\n - ``fun``\n Final objective value.\n\n - ``simplex_nit`` : int\n Number of iterations accomplished by the simplex\n solver.\n\n - ``ipm_nit`` : int\n Number of iterations accomplished by the interior-\n point solver.\n\n If model_status is not one of the above:\n\n - ``status`` : int\n Model status code.\n\n - ``message`` : str\n Message corresponding to model status code.\n\n Notes\n -----\n If ``options['write_solution_to_file']`` is ``True`` but\n ``options['solution_file']`` is unset or ``''``, then the solution\n will be printed to ``stdout``.\n\n If any iteration limit is reached, no solution will be\n available.\n\n ``OptimizeWarning`` will be raised if any option value set by\n the user is found to be incorrect.\n\n References\n ----------\n .. [1] https://highs.dev/\n .. [2] https://www.maths.ed.ac.uk/hall/HiGHS/HighsOptions.html\n ");
23171 : static PyMethodDef __pyx_mdef_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_1_highs_wrapper = {"_highs_wrapper", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_1_highs_wrapper, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__highs_wrapper};
23172 1001 : static PyObject *__pyx_pw_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_1_highs_wrapper(PyObject *__pyx_self,
23173 : #if CYTHON_METH_FASTCALL
23174 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23175 : #else
23176 : PyObject *__pyx_args, PyObject *__pyx_kwds
23177 : #endif
23178 : ) {
23179 1001 : __Pyx_memviewslice __pyx_v_c = { 0, 0, { 0 }, { 0 }, { 0 } };
23180 1001 : __Pyx_memviewslice __pyx_v_astart = { 0, 0, { 0 }, { 0 }, { 0 } };
23181 1001 : __Pyx_memviewslice __pyx_v_aindex = { 0, 0, { 0 }, { 0 }, { 0 } };
23182 1001 : __Pyx_memviewslice __pyx_v_avalue = { 0, 0, { 0 }, { 0 }, { 0 } };
23183 1001 : __Pyx_memviewslice __pyx_v_lhs = { 0, 0, { 0 }, { 0 }, { 0 } };
23184 1001 : __Pyx_memviewslice __pyx_v_rhs = { 0, 0, { 0 }, { 0 }, { 0 } };
23185 1001 : __Pyx_memviewslice __pyx_v_lb = { 0, 0, { 0 }, { 0 }, { 0 } };
23186 1001 : __Pyx_memviewslice __pyx_v_ub = { 0, 0, { 0 }, { 0 }, { 0 } };
23187 1001 : __Pyx_memviewslice __pyx_v_integrality = { 0, 0, { 0 }, { 0 }, { 0 } };
23188 1001 : PyObject *__pyx_v_options = 0;
23189 : #if !CYTHON_METH_FASTCALL
23190 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23191 : #endif
23192 1001 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23193 1001 : PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
23194 1001 : int __pyx_lineno = 0;
23195 1001 : const char *__pyx_filename = NULL;
23196 1001 : int __pyx_clineno = 0;
23197 1001 : PyObject *__pyx_r = 0;
23198 : __Pyx_RefNannyDeclarations
23199 1001 : __Pyx_RefNannySetupContext("_highs_wrapper (wrapper)", 0);
23200 : #if !CYTHON_METH_FASTCALL
23201 : #if CYTHON_ASSUME_SAFE_MACROS
23202 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23203 : #else
23204 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23205 : #endif
23206 : #endif
23207 1001 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23208 1001 : {
23209 1001 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c,&__pyx_n_s_astart,&__pyx_n_s_aindex,&__pyx_n_s_avalue,&__pyx_n_s_lhs,&__pyx_n_s_rhs,&__pyx_n_s_lb,&__pyx_n_s_ub,&__pyx_n_s_integrality,&__pyx_n_s_options,0};
23210 1001 : if (__pyx_kwds) {
23211 0 : Py_ssize_t kw_args;
23212 0 : switch (__pyx_nargs) {
23213 0 : case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
23214 0 : CYTHON_FALLTHROUGH;
23215 0 : case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
23216 0 : CYTHON_FALLTHROUGH;
23217 0 : case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
23218 0 : CYTHON_FALLTHROUGH;
23219 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
23220 0 : CYTHON_FALLTHROUGH;
23221 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
23222 0 : CYTHON_FALLTHROUGH;
23223 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
23224 0 : CYTHON_FALLTHROUGH;
23225 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
23226 0 : CYTHON_FALLTHROUGH;
23227 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
23228 0 : CYTHON_FALLTHROUGH;
23229 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
23230 0 : CYTHON_FALLTHROUGH;
23231 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23232 0 : CYTHON_FALLTHROUGH;
23233 0 : case 0: break;
23234 0 : default: goto __pyx_L5_argtuple_error;
23235 : }
23236 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
23237 0 : switch (__pyx_nargs) {
23238 0 : case 0:
23239 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) {
23240 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
23241 0 : kw_args--;
23242 : }
23243 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23244 0 : else goto __pyx_L5_argtuple_error;
23245 0 : CYTHON_FALLTHROUGH;
23246 0 : case 1:
23247 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_astart)) != 0)) {
23248 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
23249 0 : kw_args--;
23250 : }
23251 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23252 : else {
23253 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 1); __PYX_ERR(0, 238, __pyx_L3_error)
23254 : }
23255 0 : CYTHON_FALLTHROUGH;
23256 0 : case 2:
23257 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aindex)) != 0)) {
23258 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
23259 0 : kw_args--;
23260 : }
23261 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23262 : else {
23263 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 2); __PYX_ERR(0, 238, __pyx_L3_error)
23264 : }
23265 0 : CYTHON_FALLTHROUGH;
23266 0 : case 3:
23267 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_avalue)) != 0)) {
23268 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
23269 0 : kw_args--;
23270 : }
23271 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23272 : else {
23273 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 3); __PYX_ERR(0, 238, __pyx_L3_error)
23274 : }
23275 0 : CYTHON_FALLTHROUGH;
23276 0 : case 4:
23277 0 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lhs)) != 0)) {
23278 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
23279 0 : kw_args--;
23280 : }
23281 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23282 : else {
23283 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 4); __PYX_ERR(0, 238, __pyx_L3_error)
23284 : }
23285 0 : CYTHON_FALLTHROUGH;
23286 0 : case 5:
23287 0 : if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rhs)) != 0)) {
23288 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
23289 0 : kw_args--;
23290 : }
23291 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23292 : else {
23293 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 5); __PYX_ERR(0, 238, __pyx_L3_error)
23294 : }
23295 0 : CYTHON_FALLTHROUGH;
23296 0 : case 6:
23297 0 : if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lb)) != 0)) {
23298 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[6]);
23299 0 : kw_args--;
23300 : }
23301 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23302 : else {
23303 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 6); __PYX_ERR(0, 238, __pyx_L3_error)
23304 : }
23305 0 : CYTHON_FALLTHROUGH;
23306 0 : case 7:
23307 0 : if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ub)) != 0)) {
23308 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[7]);
23309 0 : kw_args--;
23310 : }
23311 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23312 : else {
23313 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 7); __PYX_ERR(0, 238, __pyx_L3_error)
23314 : }
23315 0 : CYTHON_FALLTHROUGH;
23316 0 : case 8:
23317 0 : if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_integrality)) != 0)) {
23318 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[8]);
23319 0 : kw_args--;
23320 : }
23321 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23322 : else {
23323 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 8); __PYX_ERR(0, 238, __pyx_L3_error)
23324 : }
23325 0 : CYTHON_FALLTHROUGH;
23326 0 : case 9:
23327 0 : if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options)) != 0)) {
23328 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[9]);
23329 0 : kw_args--;
23330 : }
23331 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error)
23332 : else {
23333 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, 9); __PYX_ERR(0, 238, __pyx_L3_error)
23334 : }
23335 : }
23336 0 : if (unlikely(kw_args > 0)) {
23337 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
23338 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_highs_wrapper") < 0)) __PYX_ERR(0, 238, __pyx_L3_error)
23339 : }
23340 1001 : } else if (unlikely(__pyx_nargs != 10)) {
23341 0 : goto __pyx_L5_argtuple_error;
23342 : } else {
23343 1001 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23344 1001 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
23345 1001 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
23346 1001 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
23347 1001 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
23348 1001 : values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
23349 1001 : values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
23350 1001 : values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
23351 1001 : values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
23352 1001 : values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
23353 : }
23354 1001 : __pyx_v_c = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_c.memview)) __PYX_ERR(0, 239, __pyx_L3_error)
23355 1001 : __pyx_v_astart = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_astart.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
23356 1001 : __pyx_v_aindex = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_aindex.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
23357 1001 : __pyx_v_avalue = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_avalue.memview)) __PYX_ERR(0, 242, __pyx_L3_error)
23358 1001 : __pyx_v_lhs = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_lhs.memview)) __PYX_ERR(0, 243, __pyx_L3_error)
23359 1001 : __pyx_v_rhs = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rhs.memview)) __PYX_ERR(0, 244, __pyx_L3_error)
23360 1001 : __pyx_v_lb = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_lb.memview)) __PYX_ERR(0, 245, __pyx_L3_error)
23361 1001 : __pyx_v_ub = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ub.memview)) __PYX_ERR(0, 246, __pyx_L3_error)
23362 1001 : __pyx_v_integrality = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_integrality.memview)) __PYX_ERR(0, 247, __pyx_L3_error)
23363 1001 : __pyx_v_options = ((PyObject*)values[9]);
23364 : }
23365 1001 : goto __pyx_L6_skip;
23366 0 : __pyx_L5_argtuple_error:;
23367 0 : __Pyx_RaiseArgtupleInvalid("_highs_wrapper", 1, 10, 10, __pyx_nargs); __PYX_ERR(0, 238, __pyx_L3_error)
23368 1001 : __pyx_L6_skip:;
23369 1001 : goto __pyx_L4_argument_unpacking_done;
23370 0 : __pyx_L3_error:;
23371 0 : {
23372 0 : Py_ssize_t __pyx_temp;
23373 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23374 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23375 : }
23376 : }
23377 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c, 1);
23378 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_astart, 1);
23379 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_aindex, 1);
23380 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_avalue, 1);
23381 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_lhs, 1);
23382 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_rhs, 1);
23383 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_lb, 1);
23384 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ub, 1);
23385 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_integrality, 1);
23386 0 : __Pyx_AddTraceback("scipy.optimize._highs.cython.src._highs_wrapper._highs_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
23387 : __Pyx_RefNannyFinishContext();
23388 : return NULL;
23389 1001 : __pyx_L4_argument_unpacking_done:;
23390 1001 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), (&PyDict_Type), 1, "options", 1))) __PYX_ERR(0, 248, __pyx_L1_error)
23391 1001 : __pyx_r = __pyx_pf_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__highs_wrapper(__pyx_self, __pyx_v_c, __pyx_v_astart, __pyx_v_aindex, __pyx_v_avalue, __pyx_v_lhs, __pyx_v_rhs, __pyx_v_lb, __pyx_v_ub, __pyx_v_integrality, __pyx_v_options);
23392 :
23393 : /* function exit code */
23394 1001 : goto __pyx_L0;
23395 0 : __pyx_L1_error:;
23396 0 : __pyx_r = NULL;
23397 1001 : __pyx_L0:;
23398 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c, 1);
23399 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_astart, 1);
23400 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_aindex, 1);
23401 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_avalue, 1);
23402 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_lhs, 1);
23403 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_rhs, 1);
23404 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_lb, 1);
23405 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ub, 1);
23406 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_integrality, 1);
23407 : {
23408 : Py_ssize_t __pyx_temp;
23409 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23410 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23411 : }
23412 : }
23413 : __Pyx_RefNannyFinishContext();
23414 : return __pyx_r;
23415 : }
23416 :
23417 1001 : static PyObject *__pyx_pf_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__highs_wrapper(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_c, __Pyx_memviewslice __pyx_v_astart, __Pyx_memviewslice __pyx_v_aindex, __Pyx_memviewslice __pyx_v_avalue, __Pyx_memviewslice __pyx_v_lhs, __Pyx_memviewslice __pyx_v_rhs, __Pyx_memviewslice __pyx_v_lb, __Pyx_memviewslice __pyx_v_ub, __Pyx_memviewslice __pyx_v_integrality, PyObject *__pyx_v_options) {
23418 1001 : int __pyx_v_numcol;
23419 1001 : int __pyx_v_numrow;
23420 1001 : int __pyx_v_numnz;
23421 1001 : int __pyx_v_numintegrality;
23422 1001 : HighsLp __pyx_v_lp;
23423 1001 : HighsVarType *__pyx_v_integrality_ptr;
23424 1001 : double *__pyx_v_colcost_ptr;
23425 1001 : double *__pyx_v_collower_ptr;
23426 1001 : double *__pyx_v_colupper_ptr;
23427 1001 : double *__pyx_v_rowlower_ptr;
23428 1001 : double *__pyx_v_rowupper_ptr;
23429 1001 : int *__pyx_v_astart_ptr;
23430 1001 : int *__pyx_v_aindex_ptr;
23431 1001 : double *__pyx_v_avalue_ptr;
23432 1001 : Highs __pyx_v_highs;
23433 1001 : HighsModelStatus __pyx_v_err_model_status;
23434 1001 : HighsStatus __pyx_v_init_status;
23435 1001 : HighsStatus __pyx_v_run_status;
23436 1001 : HighsModelStatus __pyx_v_model_status;
23437 1001 : HighsInfo __pyx_v_info;
23438 1001 : HighsSolution __pyx_v_solution;
23439 1001 : HighsBasis __pyx_v_basis;
23440 1001 : __Pyx_memviewslice __pyx_v_marg_bnds = { 0, 0, { 0 }, { 0 }, { 0 } };
23441 1001 : PyObject *__pyx_v_mipFailCondition = NULL;
23442 1001 : PyObject *__pyx_v_lpFailCondition = NULL;
23443 1001 : int __pyx_v_ii;
23444 1001 : PyObject *__pyx_v_res = NULL;
23445 1001 : int __pyx_7genexpr__pyx_v_ii;
23446 1001 : int __pyx_8genexpr1__pyx_v_ii;
23447 1001 : int __pyx_8genexpr2__pyx_v_ii;
23448 1001 : PyObject *__pyx_r = NULL;
23449 : __Pyx_RefNannyDeclarations
23450 1001 : PyObject *__pyx_t_1 = NULL;
23451 1001 : PyObject *__pyx_t_2 = NULL;
23452 1001 : int __pyx_t_3;
23453 1001 : int __pyx_t_4;
23454 1001 : Py_ssize_t __pyx_t_5;
23455 1001 : PyObject *__pyx_t_6 = NULL;
23456 1001 : PyObject *__pyx_t_7 = NULL;
23457 1001 : unsigned int __pyx_t_8;
23458 1001 : __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
23459 1001 : int __pyx_t_10;
23460 1001 : Py_ssize_t __pyx_t_11;
23461 1001 : Py_UCS4 __pyx_t_12;
23462 1001 : int __pyx_t_13;
23463 1001 : int __pyx_t_14;
23464 1001 : Py_ssize_t __pyx_t_15;
23465 1001 : int __pyx_t_16;
23466 1001 : int __pyx_lineno = 0;
23467 1001 : const char *__pyx_filename = NULL;
23468 1001 : int __pyx_clineno = 0;
23469 1001 : __Pyx_RefNannySetupContext("_highs_wrapper", 1);
23470 :
23471 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":560
23472 : * '''
23473 : *
23474 : * cdef int numcol = c.size # <<<<<<<<<<<<<<
23475 : * cdef int numrow = rhs.size
23476 : * cdef int numnz = avalue.size
23477 : */
23478 1001 : __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
23479 1001 : __Pyx_GOTREF(__pyx_t_1);
23480 1001 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
23481 1001 : __Pyx_GOTREF(__pyx_t_2);
23482 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23483 1001 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error)
23484 1001 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23485 1001 : __pyx_v_numcol = __pyx_t_3;
23486 :
23487 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":561
23488 : *
23489 : * cdef int numcol = c.size
23490 : * cdef int numrow = rhs.size # <<<<<<<<<<<<<<
23491 : * cdef int numnz = avalue.size
23492 : * cdef int numintegrality = integrality.size
23493 : */
23494 1001 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_rhs, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
23495 1001 : __Pyx_GOTREF(__pyx_t_2);
23496 1001 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
23497 1001 : __Pyx_GOTREF(__pyx_t_1);
23498 1001 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23499 1001 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L1_error)
23500 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23501 1001 : __pyx_v_numrow = __pyx_t_3;
23502 :
23503 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":562
23504 : * cdef int numcol = c.size
23505 : * cdef int numrow = rhs.size
23506 : * cdef int numnz = avalue.size # <<<<<<<<<<<<<<
23507 : * cdef int numintegrality = integrality.size
23508 : *
23509 : */
23510 1001 : __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_avalue, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
23511 1001 : __Pyx_GOTREF(__pyx_t_1);
23512 1001 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
23513 1001 : __Pyx_GOTREF(__pyx_t_2);
23514 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23515 1001 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error)
23516 1001 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23517 1001 : __pyx_v_numnz = __pyx_t_3;
23518 :
23519 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":563
23520 : * cdef int numrow = rhs.size
23521 : * cdef int numnz = avalue.size
23522 : * cdef int numintegrality = integrality.size # <<<<<<<<<<<<<<
23523 : *
23524 : * # Fill up a HighsLp object
23525 : */
23526 1001 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_integrality, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
23527 1001 : __Pyx_GOTREF(__pyx_t_2);
23528 1001 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
23529 1001 : __Pyx_GOTREF(__pyx_t_1);
23530 1001 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23531 1001 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 563, __pyx_L1_error)
23532 1001 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23533 1001 : __pyx_v_numintegrality = __pyx_t_3;
23534 :
23535 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":567
23536 : * # Fill up a HighsLp object
23537 : * cdef HighsLp lp
23538 : * lp.num_col_ = numcol # <<<<<<<<<<<<<<
23539 : * lp.num_row_ = numrow
23540 : * lp.a_matrix_.num_col_ = numcol
23541 : */
23542 1001 : __pyx_v_lp.num_col_ = __pyx_v_numcol;
23543 :
23544 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":568
23545 : * cdef HighsLp lp
23546 : * lp.num_col_ = numcol
23547 : * lp.num_row_ = numrow # <<<<<<<<<<<<<<
23548 : * lp.a_matrix_.num_col_ = numcol
23549 : * lp.a_matrix_.num_row_ = numrow
23550 : */
23551 1001 : __pyx_v_lp.num_row_ = __pyx_v_numrow;
23552 :
23553 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":569
23554 : * lp.num_col_ = numcol
23555 : * lp.num_row_ = numrow
23556 : * lp.a_matrix_.num_col_ = numcol # <<<<<<<<<<<<<<
23557 : * lp.a_matrix_.num_row_ = numrow
23558 : * lp.a_matrix_.format_ = MatrixFormatkColwise
23559 : */
23560 1001 : __pyx_v_lp.a_matrix_.num_col_ = __pyx_v_numcol;
23561 :
23562 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":570
23563 : * lp.num_row_ = numrow
23564 : * lp.a_matrix_.num_col_ = numcol
23565 : * lp.a_matrix_.num_row_ = numrow # <<<<<<<<<<<<<<
23566 : * lp.a_matrix_.format_ = MatrixFormatkColwise
23567 : *
23568 : */
23569 1001 : __pyx_v_lp.a_matrix_.num_row_ = __pyx_v_numrow;
23570 :
23571 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":571
23572 : * lp.a_matrix_.num_col_ = numcol
23573 : * lp.a_matrix_.num_row_ = numrow
23574 : * lp.a_matrix_.format_ = MatrixFormatkColwise # <<<<<<<<<<<<<<
23575 : *
23576 : * lp.col_cost_.resize(numcol)
23577 : */
23578 1001 : __pyx_v_lp.a_matrix_.format_ = MatrixFormat::kColwise;
23579 :
23580 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":573
23581 : * lp.a_matrix_.format_ = MatrixFormatkColwise
23582 : *
23583 : * lp.col_cost_.resize(numcol) # <<<<<<<<<<<<<<
23584 : * lp.col_lower_.resize(numcol)
23585 : * lp.col_upper_.resize(numcol)
23586 : */
23587 1001 : try {
23588 1001 : __pyx_v_lp.col_cost_.resize(__pyx_v_numcol);
23589 0 : } catch(...) {
23590 0 : __Pyx_CppExn2PyErr();
23591 0 : __PYX_ERR(0, 573, __pyx_L1_error)
23592 0 : }
23593 :
23594 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":574
23595 : *
23596 : * lp.col_cost_.resize(numcol)
23597 : * lp.col_lower_.resize(numcol) # <<<<<<<<<<<<<<
23598 : * lp.col_upper_.resize(numcol)
23599 : *
23600 : */
23601 1001 : try {
23602 1001 : __pyx_v_lp.col_lower_.resize(__pyx_v_numcol);
23603 0 : } catch(...) {
23604 0 : __Pyx_CppExn2PyErr();
23605 0 : __PYX_ERR(0, 574, __pyx_L1_error)
23606 0 : }
23607 :
23608 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":575
23609 : * lp.col_cost_.resize(numcol)
23610 : * lp.col_lower_.resize(numcol)
23611 : * lp.col_upper_.resize(numcol) # <<<<<<<<<<<<<<
23612 : *
23613 : * lp.row_lower_.resize(numrow)
23614 : */
23615 1001 : try {
23616 1001 : __pyx_v_lp.col_upper_.resize(__pyx_v_numcol);
23617 0 : } catch(...) {
23618 0 : __Pyx_CppExn2PyErr();
23619 0 : __PYX_ERR(0, 575, __pyx_L1_error)
23620 0 : }
23621 :
23622 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":577
23623 : * lp.col_upper_.resize(numcol)
23624 : *
23625 : * lp.row_lower_.resize(numrow) # <<<<<<<<<<<<<<
23626 : * lp.row_upper_.resize(numrow)
23627 : * lp.a_matrix_.start_.resize(numcol + 1)
23628 : */
23629 1001 : try {
23630 1001 : __pyx_v_lp.row_lower_.resize(__pyx_v_numrow);
23631 0 : } catch(...) {
23632 0 : __Pyx_CppExn2PyErr();
23633 0 : __PYX_ERR(0, 577, __pyx_L1_error)
23634 0 : }
23635 :
23636 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":578
23637 : *
23638 : * lp.row_lower_.resize(numrow)
23639 : * lp.row_upper_.resize(numrow) # <<<<<<<<<<<<<<
23640 : * lp.a_matrix_.start_.resize(numcol + 1)
23641 : * lp.a_matrix_.index_.resize(numnz)
23642 : */
23643 1001 : try {
23644 1001 : __pyx_v_lp.row_upper_.resize(__pyx_v_numrow);
23645 0 : } catch(...) {
23646 0 : __Pyx_CppExn2PyErr();
23647 0 : __PYX_ERR(0, 578, __pyx_L1_error)
23648 0 : }
23649 :
23650 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":579
23651 : * lp.row_lower_.resize(numrow)
23652 : * lp.row_upper_.resize(numrow)
23653 : * lp.a_matrix_.start_.resize(numcol + 1) # <<<<<<<<<<<<<<
23654 : * lp.a_matrix_.index_.resize(numnz)
23655 : * lp.a_matrix_.value_.resize(numnz)
23656 : */
23657 1001 : try {
23658 1001 : __pyx_v_lp.a_matrix_.start_.resize((__pyx_v_numcol + 1));
23659 0 : } catch(...) {
23660 0 : __Pyx_CppExn2PyErr();
23661 0 : __PYX_ERR(0, 579, __pyx_L1_error)
23662 0 : }
23663 :
23664 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":580
23665 : * lp.row_upper_.resize(numrow)
23666 : * lp.a_matrix_.start_.resize(numcol + 1)
23667 : * lp.a_matrix_.index_.resize(numnz) # <<<<<<<<<<<<<<
23668 : * lp.a_matrix_.value_.resize(numnz)
23669 : *
23670 : */
23671 1001 : try {
23672 1001 : __pyx_v_lp.a_matrix_.index_.resize(__pyx_v_numnz);
23673 0 : } catch(...) {
23674 0 : __Pyx_CppExn2PyErr();
23675 0 : __PYX_ERR(0, 580, __pyx_L1_error)
23676 0 : }
23677 :
23678 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":581
23679 : * lp.a_matrix_.start_.resize(numcol + 1)
23680 : * lp.a_matrix_.index_.resize(numnz)
23681 : * lp.a_matrix_.value_.resize(numnz) # <<<<<<<<<<<<<<
23682 : *
23683 : * # only need to set integrality if it's not's empty
23684 : */
23685 1001 : try {
23686 1001 : __pyx_v_lp.a_matrix_.value_.resize(__pyx_v_numnz);
23687 0 : } catch(...) {
23688 0 : __Pyx_CppExn2PyErr();
23689 0 : __PYX_ERR(0, 581, __pyx_L1_error)
23690 0 : }
23691 :
23692 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":584
23693 : *
23694 : * # only need to set integrality if it's not's empty
23695 : * cdef HighsVarType * integrality_ptr = NULL # <<<<<<<<<<<<<<
23696 : * if numintegrality > 0:
23697 : * lp.integrality_.resize(numintegrality)
23698 : */
23699 1001 : __pyx_v_integrality_ptr = NULL;
23700 :
23701 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":585
23702 : * # only need to set integrality if it's not's empty
23703 : * cdef HighsVarType * integrality_ptr = NULL
23704 : * if numintegrality > 0: # <<<<<<<<<<<<<<
23705 : * lp.integrality_.resize(numintegrality)
23706 : * integrality_ptr = reinterpret_cast[HighsVarType_ptr](&integrality[0])
23707 : */
23708 1001 : __pyx_t_4 = (__pyx_v_numintegrality > 0);
23709 1001 : if (__pyx_t_4) {
23710 :
23711 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":586
23712 : * cdef HighsVarType * integrality_ptr = NULL
23713 : * if numintegrality > 0:
23714 : * lp.integrality_.resize(numintegrality) # <<<<<<<<<<<<<<
23715 : * integrality_ptr = reinterpret_cast[HighsVarType_ptr](&integrality[0])
23716 : * lp.integrality_.assign(integrality_ptr, integrality_ptr + numcol)
23717 : */
23718 256 : try {
23719 256 : __pyx_v_lp.integrality_.resize(__pyx_v_numintegrality);
23720 0 : } catch(...) {
23721 0 : __Pyx_CppExn2PyErr();
23722 0 : __PYX_ERR(0, 586, __pyx_L1_error)
23723 0 : }
23724 :
23725 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":587
23726 : * if numintegrality > 0:
23727 : * lp.integrality_.resize(numintegrality)
23728 : * integrality_ptr = reinterpret_cast[HighsVarType_ptr](&integrality[0]) # <<<<<<<<<<<<<<
23729 : * lp.integrality_.assign(integrality_ptr, integrality_ptr + numcol)
23730 : *
23731 : */
23732 256 : __pyx_t_5 = 0;
23733 256 : __pyx_t_3 = -1;
23734 256 : if (__pyx_t_5 < 0) {
23735 : __pyx_t_5 += __pyx_v_integrality.shape[0];
23736 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
23737 256 : } else if (unlikely(__pyx_t_5 >= __pyx_v_integrality.shape[0])) __pyx_t_3 = 0;
23738 256 : if (unlikely(__pyx_t_3 != -1)) {
23739 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
23740 0 : __PYX_ERR(0, 587, __pyx_L1_error)
23741 : }
23742 256 : __pyx_v_integrality_ptr = reinterpret_cast<__pyx_t_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_HighsVarType_ptr>((&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_integrality.data) + __pyx_t_5)) )))));
23743 :
23744 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":588
23745 : * lp.integrality_.resize(numintegrality)
23746 : * integrality_ptr = reinterpret_cast[HighsVarType_ptr](&integrality[0])
23747 : * lp.integrality_.assign(integrality_ptr, integrality_ptr + numcol) # <<<<<<<<<<<<<<
23748 : *
23749 : * # Explicitly create pointers to pass to HiGHS C++ API;
23750 : */
23751 256 : try {
23752 256 : __pyx_v_lp.integrality_.assign(__pyx_v_integrality_ptr, (__pyx_v_integrality_ptr + __pyx_v_numcol));
23753 0 : } catch(...) {
23754 0 : __Pyx_CppExn2PyErr();
23755 0 : __PYX_ERR(0, 588, __pyx_L1_error)
23756 0 : }
23757 :
23758 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":585
23759 : * # only need to set integrality if it's not's empty
23760 : * cdef HighsVarType * integrality_ptr = NULL
23761 : * if numintegrality > 0: # <<<<<<<<<<<<<<
23762 : * lp.integrality_.resize(numintegrality)
23763 : * integrality_ptr = reinterpret_cast[HighsVarType_ptr](&integrality[0])
23764 : */
23765 : }
23766 :
23767 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":595
23768 : * # empty!)
23769 : * cdef:
23770 : * double * colcost_ptr = NULL # <<<<<<<<<<<<<<
23771 : * double * collower_ptr = NULL
23772 : * double * colupper_ptr = NULL
23773 : */
23774 1001 : __pyx_v_colcost_ptr = NULL;
23775 :
23776 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":596
23777 : * cdef:
23778 : * double * colcost_ptr = NULL
23779 : * double * collower_ptr = NULL # <<<<<<<<<<<<<<
23780 : * double * colupper_ptr = NULL
23781 : * double * rowlower_ptr = NULL
23782 : */
23783 1001 : __pyx_v_collower_ptr = NULL;
23784 :
23785 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":597
23786 : * double * colcost_ptr = NULL
23787 : * double * collower_ptr = NULL
23788 : * double * colupper_ptr = NULL # <<<<<<<<<<<<<<
23789 : * double * rowlower_ptr = NULL
23790 : * double * rowupper_ptr = NULL
23791 : */
23792 1001 : __pyx_v_colupper_ptr = NULL;
23793 :
23794 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":598
23795 : * double * collower_ptr = NULL
23796 : * double * colupper_ptr = NULL
23797 : * double * rowlower_ptr = NULL # <<<<<<<<<<<<<<
23798 : * double * rowupper_ptr = NULL
23799 : * int * astart_ptr = NULL
23800 : */
23801 1001 : __pyx_v_rowlower_ptr = NULL;
23802 :
23803 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":599
23804 : * double * colupper_ptr = NULL
23805 : * double * rowlower_ptr = NULL
23806 : * double * rowupper_ptr = NULL # <<<<<<<<<<<<<<
23807 : * int * astart_ptr = NULL
23808 : * int * aindex_ptr = NULL
23809 : */
23810 1001 : __pyx_v_rowupper_ptr = NULL;
23811 :
23812 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":600
23813 : * double * rowlower_ptr = NULL
23814 : * double * rowupper_ptr = NULL
23815 : * int * astart_ptr = NULL # <<<<<<<<<<<<<<
23816 : * int * aindex_ptr = NULL
23817 : * double * avalue_ptr = NULL
23818 : */
23819 1001 : __pyx_v_astart_ptr = NULL;
23820 :
23821 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":601
23822 : * double * rowupper_ptr = NULL
23823 : * int * astart_ptr = NULL
23824 : * int * aindex_ptr = NULL # <<<<<<<<<<<<<<
23825 : * double * avalue_ptr = NULL
23826 : * if numrow > 0:
23827 : */
23828 1001 : __pyx_v_aindex_ptr = NULL;
23829 :
23830 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":602
23831 : * int * astart_ptr = NULL
23832 : * int * aindex_ptr = NULL
23833 : * double * avalue_ptr = NULL # <<<<<<<<<<<<<<
23834 : * if numrow > 0:
23835 : * rowlower_ptr = &lhs[0]
23836 : */
23837 1001 : __pyx_v_avalue_ptr = NULL;
23838 :
23839 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":603
23840 : * int * aindex_ptr = NULL
23841 : * double * avalue_ptr = NULL
23842 : * if numrow > 0: # <<<<<<<<<<<<<<
23843 : * rowlower_ptr = &lhs[0]
23844 : * rowupper_ptr = &rhs[0]
23845 : */
23846 1001 : __pyx_t_4 = (__pyx_v_numrow > 0);
23847 1001 : if (__pyx_t_4) {
23848 :
23849 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":604
23850 : * double * avalue_ptr = NULL
23851 : * if numrow > 0:
23852 : * rowlower_ptr = &lhs[0] # <<<<<<<<<<<<<<
23853 : * rowupper_ptr = &rhs[0]
23854 : * lp.row_lower_.assign(rowlower_ptr, rowlower_ptr + numrow)
23855 : */
23856 950 : __pyx_t_5 = 0;
23857 950 : __pyx_t_3 = -1;
23858 950 : if (__pyx_t_5 < 0) {
23859 : __pyx_t_5 += __pyx_v_lhs.shape[0];
23860 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
23861 950 : } else if (unlikely(__pyx_t_5 >= __pyx_v_lhs.shape[0])) __pyx_t_3 = 0;
23862 950 : if (unlikely(__pyx_t_3 != -1)) {
23863 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
23864 0 : __PYX_ERR(0, 604, __pyx_L1_error)
23865 : }
23866 950 : __pyx_v_rowlower_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_lhs.data) + __pyx_t_5)) ))));
23867 :
23868 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":605
23869 : * if numrow > 0:
23870 : * rowlower_ptr = &lhs[0]
23871 : * rowupper_ptr = &rhs[0] # <<<<<<<<<<<<<<
23872 : * lp.row_lower_.assign(rowlower_ptr, rowlower_ptr + numrow)
23873 : * lp.row_upper_.assign(rowupper_ptr, rowupper_ptr + numrow)
23874 : */
23875 950 : __pyx_t_5 = 0;
23876 950 : __pyx_t_3 = -1;
23877 950 : if (__pyx_t_5 < 0) {
23878 : __pyx_t_5 += __pyx_v_rhs.shape[0];
23879 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
23880 950 : } else if (unlikely(__pyx_t_5 >= __pyx_v_rhs.shape[0])) __pyx_t_3 = 0;
23881 950 : if (unlikely(__pyx_t_3 != -1)) {
23882 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
23883 0 : __PYX_ERR(0, 605, __pyx_L1_error)
23884 : }
23885 950 : __pyx_v_rowupper_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_rhs.data) + __pyx_t_5)) ))));
23886 :
23887 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":606
23888 : * rowlower_ptr = &lhs[0]
23889 : * rowupper_ptr = &rhs[0]
23890 : * lp.row_lower_.assign(rowlower_ptr, rowlower_ptr + numrow) # <<<<<<<<<<<<<<
23891 : * lp.row_upper_.assign(rowupper_ptr, rowupper_ptr + numrow)
23892 : * else:
23893 : */
23894 950 : try {
23895 950 : __pyx_v_lp.row_lower_.assign(__pyx_v_rowlower_ptr, (__pyx_v_rowlower_ptr + __pyx_v_numrow));
23896 0 : } catch(...) {
23897 0 : __Pyx_CppExn2PyErr();
23898 0 : __PYX_ERR(0, 606, __pyx_L1_error)
23899 0 : }
23900 :
23901 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":607
23902 : * rowupper_ptr = &rhs[0]
23903 : * lp.row_lower_.assign(rowlower_ptr, rowlower_ptr + numrow)
23904 : * lp.row_upper_.assign(rowupper_ptr, rowupper_ptr + numrow) # <<<<<<<<<<<<<<
23905 : * else:
23906 : * lp.row_lower_.empty()
23907 : */
23908 950 : try {
23909 950 : __pyx_v_lp.row_upper_.assign(__pyx_v_rowupper_ptr, (__pyx_v_rowupper_ptr + __pyx_v_numrow));
23910 0 : } catch(...) {
23911 0 : __Pyx_CppExn2PyErr();
23912 0 : __PYX_ERR(0, 607, __pyx_L1_error)
23913 0 : }
23914 :
23915 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":603
23916 : * int * aindex_ptr = NULL
23917 : * double * avalue_ptr = NULL
23918 : * if numrow > 0: # <<<<<<<<<<<<<<
23919 : * rowlower_ptr = &lhs[0]
23920 : * rowupper_ptr = &rhs[0]
23921 : */
23922 950 : goto __pyx_L4;
23923 : }
23924 :
23925 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":609
23926 : * lp.row_upper_.assign(rowupper_ptr, rowupper_ptr + numrow)
23927 : * else:
23928 : * lp.row_lower_.empty() # <<<<<<<<<<<<<<
23929 : * lp.row_upper_.empty()
23930 : * if numcol > 0:
23931 : */
23932 : /*else*/ {
23933 : (void)(__pyx_v_lp.row_lower_.empty());
23934 :
23935 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":610
23936 : * else:
23937 : * lp.row_lower_.empty()
23938 : * lp.row_upper_.empty() # <<<<<<<<<<<<<<
23939 : * if numcol > 0:
23940 : * colcost_ptr = &c[0]
23941 : */
23942 : (void)(__pyx_v_lp.row_upper_.empty());
23943 : }
23944 1001 : __pyx_L4:;
23945 :
23946 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":611
23947 : * lp.row_lower_.empty()
23948 : * lp.row_upper_.empty()
23949 : * if numcol > 0: # <<<<<<<<<<<<<<
23950 : * colcost_ptr = &c[0]
23951 : * collower_ptr = &lb[0]
23952 : */
23953 1001 : __pyx_t_4 = (__pyx_v_numcol > 0);
23954 1001 : if (__pyx_t_4) {
23955 :
23956 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":612
23957 : * lp.row_upper_.empty()
23958 : * if numcol > 0:
23959 : * colcost_ptr = &c[0] # <<<<<<<<<<<<<<
23960 : * collower_ptr = &lb[0]
23961 : * colupper_ptr = &ub[0]
23962 : */
23963 1001 : __pyx_t_5 = 0;
23964 1001 : __pyx_t_3 = -1;
23965 1001 : if (__pyx_t_5 < 0) {
23966 : __pyx_t_5 += __pyx_v_c.shape[0];
23967 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
23968 1001 : } else if (unlikely(__pyx_t_5 >= __pyx_v_c.shape[0])) __pyx_t_3 = 0;
23969 1001 : if (unlikely(__pyx_t_3 != -1)) {
23970 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
23971 0 : __PYX_ERR(0, 612, __pyx_L1_error)
23972 : }
23973 1001 : __pyx_v_colcost_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_c.data) + __pyx_t_5)) ))));
23974 :
23975 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":613
23976 : * if numcol > 0:
23977 : * colcost_ptr = &c[0]
23978 : * collower_ptr = &lb[0] # <<<<<<<<<<<<<<
23979 : * colupper_ptr = &ub[0]
23980 : * lp.col_cost_.assign(colcost_ptr, colcost_ptr + numcol)
23981 : */
23982 1001 : __pyx_t_5 = 0;
23983 1001 : __pyx_t_3 = -1;
23984 1001 : if (__pyx_t_5 < 0) {
23985 : __pyx_t_5 += __pyx_v_lb.shape[0];
23986 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
23987 1001 : } else if (unlikely(__pyx_t_5 >= __pyx_v_lb.shape[0])) __pyx_t_3 = 0;
23988 1001 : if (unlikely(__pyx_t_3 != -1)) {
23989 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
23990 0 : __PYX_ERR(0, 613, __pyx_L1_error)
23991 : }
23992 1001 : __pyx_v_collower_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_lb.data) + __pyx_t_5)) ))));
23993 :
23994 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":614
23995 : * colcost_ptr = &c[0]
23996 : * collower_ptr = &lb[0]
23997 : * colupper_ptr = &ub[0] # <<<<<<<<<<<<<<
23998 : * lp.col_cost_.assign(colcost_ptr, colcost_ptr + numcol)
23999 : * lp.col_lower_.assign(collower_ptr, collower_ptr + numcol)
24000 : */
24001 1001 : __pyx_t_5 = 0;
24002 1001 : __pyx_t_3 = -1;
24003 1001 : if (__pyx_t_5 < 0) {
24004 : __pyx_t_5 += __pyx_v_ub.shape[0];
24005 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
24006 1001 : } else if (unlikely(__pyx_t_5 >= __pyx_v_ub.shape[0])) __pyx_t_3 = 0;
24007 1001 : if (unlikely(__pyx_t_3 != -1)) {
24008 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
24009 0 : __PYX_ERR(0, 614, __pyx_L1_error)
24010 : }
24011 1001 : __pyx_v_colupper_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_ub.data) + __pyx_t_5)) ))));
24012 :
24013 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":615
24014 : * collower_ptr = &lb[0]
24015 : * colupper_ptr = &ub[0]
24016 : * lp.col_cost_.assign(colcost_ptr, colcost_ptr + numcol) # <<<<<<<<<<<<<<
24017 : * lp.col_lower_.assign(collower_ptr, collower_ptr + numcol)
24018 : * lp.col_upper_.assign(colupper_ptr, colupper_ptr + numcol)
24019 : */
24020 1001 : try {
24021 1001 : __pyx_v_lp.col_cost_.assign(__pyx_v_colcost_ptr, (__pyx_v_colcost_ptr + __pyx_v_numcol));
24022 0 : } catch(...) {
24023 0 : __Pyx_CppExn2PyErr();
24024 0 : __PYX_ERR(0, 615, __pyx_L1_error)
24025 0 : }
24026 :
24027 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":616
24028 : * colupper_ptr = &ub[0]
24029 : * lp.col_cost_.assign(colcost_ptr, colcost_ptr + numcol)
24030 : * lp.col_lower_.assign(collower_ptr, collower_ptr + numcol) # <<<<<<<<<<<<<<
24031 : * lp.col_upper_.assign(colupper_ptr, colupper_ptr + numcol)
24032 : * else:
24033 : */
24034 1001 : try {
24035 1001 : __pyx_v_lp.col_lower_.assign(__pyx_v_collower_ptr, (__pyx_v_collower_ptr + __pyx_v_numcol));
24036 0 : } catch(...) {
24037 0 : __Pyx_CppExn2PyErr();
24038 0 : __PYX_ERR(0, 616, __pyx_L1_error)
24039 0 : }
24040 :
24041 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":617
24042 : * lp.col_cost_.assign(colcost_ptr, colcost_ptr + numcol)
24043 : * lp.col_lower_.assign(collower_ptr, collower_ptr + numcol)
24044 : * lp.col_upper_.assign(colupper_ptr, colupper_ptr + numcol) # <<<<<<<<<<<<<<
24045 : * else:
24046 : * lp.col_cost_.empty()
24047 : */
24048 1001 : try {
24049 1001 : __pyx_v_lp.col_upper_.assign(__pyx_v_colupper_ptr, (__pyx_v_colupper_ptr + __pyx_v_numcol));
24050 0 : } catch(...) {
24051 0 : __Pyx_CppExn2PyErr();
24052 0 : __PYX_ERR(0, 617, __pyx_L1_error)
24053 0 : }
24054 :
24055 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":611
24056 : * lp.row_lower_.empty()
24057 : * lp.row_upper_.empty()
24058 : * if numcol > 0: # <<<<<<<<<<<<<<
24059 : * colcost_ptr = &c[0]
24060 : * collower_ptr = &lb[0]
24061 : */
24062 1001 : goto __pyx_L5;
24063 : }
24064 :
24065 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":619
24066 : * lp.col_upper_.assign(colupper_ptr, colupper_ptr + numcol)
24067 : * else:
24068 : * lp.col_cost_.empty() # <<<<<<<<<<<<<<
24069 : * lp.col_lower_.empty()
24070 : * lp.col_upper_.empty()
24071 : */
24072 : /*else*/ {
24073 : (void)(__pyx_v_lp.col_cost_.empty());
24074 :
24075 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":620
24076 : * else:
24077 : * lp.col_cost_.empty()
24078 : * lp.col_lower_.empty() # <<<<<<<<<<<<<<
24079 : * lp.col_upper_.empty()
24080 : * lp.integrality_.empty()
24081 : */
24082 : (void)(__pyx_v_lp.col_lower_.empty());
24083 :
24084 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":621
24085 : * lp.col_cost_.empty()
24086 : * lp.col_lower_.empty()
24087 : * lp.col_upper_.empty() # <<<<<<<<<<<<<<
24088 : * lp.integrality_.empty()
24089 : * if numnz > 0:
24090 : */
24091 : (void)(__pyx_v_lp.col_upper_.empty());
24092 :
24093 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":622
24094 : * lp.col_lower_.empty()
24095 : * lp.col_upper_.empty()
24096 : * lp.integrality_.empty() # <<<<<<<<<<<<<<
24097 : * if numnz > 0:
24098 : * astart_ptr = &astart[0]
24099 : */
24100 : (void)(__pyx_v_lp.integrality_.empty());
24101 : }
24102 1001 : __pyx_L5:;
24103 :
24104 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":623
24105 : * lp.col_upper_.empty()
24106 : * lp.integrality_.empty()
24107 : * if numnz > 0: # <<<<<<<<<<<<<<
24108 : * astart_ptr = &astart[0]
24109 : * aindex_ptr = &aindex[0]
24110 : */
24111 1001 : __pyx_t_4 = (__pyx_v_numnz > 0);
24112 1001 : if (__pyx_t_4) {
24113 :
24114 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":624
24115 : * lp.integrality_.empty()
24116 : * if numnz > 0:
24117 : * astart_ptr = &astart[0] # <<<<<<<<<<<<<<
24118 : * aindex_ptr = &aindex[0]
24119 : * avalue_ptr = &avalue[0]
24120 : */
24121 950 : __pyx_t_5 = 0;
24122 950 : __pyx_t_3 = -1;
24123 950 : if (__pyx_t_5 < 0) {
24124 : __pyx_t_5 += __pyx_v_astart.shape[0];
24125 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
24126 950 : } else if (unlikely(__pyx_t_5 >= __pyx_v_astart.shape[0])) __pyx_t_3 = 0;
24127 950 : if (unlikely(__pyx_t_3 != -1)) {
24128 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
24129 0 : __PYX_ERR(0, 624, __pyx_L1_error)
24130 : }
24131 950 : __pyx_v_astart_ptr = (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_astart.data) + __pyx_t_5)) ))));
24132 :
24133 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":625
24134 : * if numnz > 0:
24135 : * astart_ptr = &astart[0]
24136 : * aindex_ptr = &aindex[0] # <<<<<<<<<<<<<<
24137 : * avalue_ptr = &avalue[0]
24138 : * lp.a_matrix_.start_.assign(astart_ptr, astart_ptr + numcol + 1)
24139 : */
24140 950 : __pyx_t_5 = 0;
24141 950 : __pyx_t_3 = -1;
24142 950 : if (__pyx_t_5 < 0) {
24143 : __pyx_t_5 += __pyx_v_aindex.shape[0];
24144 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
24145 950 : } else if (unlikely(__pyx_t_5 >= __pyx_v_aindex.shape[0])) __pyx_t_3 = 0;
24146 950 : if (unlikely(__pyx_t_3 != -1)) {
24147 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
24148 0 : __PYX_ERR(0, 625, __pyx_L1_error)
24149 : }
24150 950 : __pyx_v_aindex_ptr = (&(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_aindex.data) + __pyx_t_5)) ))));
24151 :
24152 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":626
24153 : * astart_ptr = &astart[0]
24154 : * aindex_ptr = &aindex[0]
24155 : * avalue_ptr = &avalue[0] # <<<<<<<<<<<<<<
24156 : * lp.a_matrix_.start_.assign(astart_ptr, astart_ptr + numcol + 1)
24157 : * lp.a_matrix_.index_.assign(aindex_ptr, aindex_ptr + numnz)
24158 : */
24159 950 : __pyx_t_5 = 0;
24160 950 : __pyx_t_3 = -1;
24161 950 : if (__pyx_t_5 < 0) {
24162 : __pyx_t_5 += __pyx_v_avalue.shape[0];
24163 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
24164 950 : } else if (unlikely(__pyx_t_5 >= __pyx_v_avalue.shape[0])) __pyx_t_3 = 0;
24165 950 : if (unlikely(__pyx_t_3 != -1)) {
24166 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
24167 0 : __PYX_ERR(0, 626, __pyx_L1_error)
24168 : }
24169 950 : __pyx_v_avalue_ptr = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_avalue.data) + __pyx_t_5)) ))));
24170 :
24171 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":627
24172 : * aindex_ptr = &aindex[0]
24173 : * avalue_ptr = &avalue[0]
24174 : * lp.a_matrix_.start_.assign(astart_ptr, astart_ptr + numcol + 1) # <<<<<<<<<<<<<<
24175 : * lp.a_matrix_.index_.assign(aindex_ptr, aindex_ptr + numnz)
24176 : * lp.a_matrix_.value_.assign(avalue_ptr, avalue_ptr + numnz)
24177 : */
24178 950 : try {
24179 950 : __pyx_v_lp.a_matrix_.start_.assign(__pyx_v_astart_ptr, ((__pyx_v_astart_ptr + __pyx_v_numcol) + 1));
24180 0 : } catch(...) {
24181 0 : __Pyx_CppExn2PyErr();
24182 0 : __PYX_ERR(0, 627, __pyx_L1_error)
24183 0 : }
24184 :
24185 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":628
24186 : * avalue_ptr = &avalue[0]
24187 : * lp.a_matrix_.start_.assign(astart_ptr, astart_ptr + numcol + 1)
24188 : * lp.a_matrix_.index_.assign(aindex_ptr, aindex_ptr + numnz) # <<<<<<<<<<<<<<
24189 : * lp.a_matrix_.value_.assign(avalue_ptr, avalue_ptr + numnz)
24190 : * else:
24191 : */
24192 950 : try {
24193 950 : __pyx_v_lp.a_matrix_.index_.assign(__pyx_v_aindex_ptr, (__pyx_v_aindex_ptr + __pyx_v_numnz));
24194 0 : } catch(...) {
24195 0 : __Pyx_CppExn2PyErr();
24196 0 : __PYX_ERR(0, 628, __pyx_L1_error)
24197 0 : }
24198 :
24199 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":629
24200 : * lp.a_matrix_.start_.assign(astart_ptr, astart_ptr + numcol + 1)
24201 : * lp.a_matrix_.index_.assign(aindex_ptr, aindex_ptr + numnz)
24202 : * lp.a_matrix_.value_.assign(avalue_ptr, avalue_ptr + numnz) # <<<<<<<<<<<<<<
24203 : * else:
24204 : * lp.a_matrix_.start_.empty()
24205 : */
24206 950 : try {
24207 950 : __pyx_v_lp.a_matrix_.value_.assign(__pyx_v_avalue_ptr, (__pyx_v_avalue_ptr + __pyx_v_numnz));
24208 0 : } catch(...) {
24209 0 : __Pyx_CppExn2PyErr();
24210 0 : __PYX_ERR(0, 629, __pyx_L1_error)
24211 0 : }
24212 :
24213 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":623
24214 : * lp.col_upper_.empty()
24215 : * lp.integrality_.empty()
24216 : * if numnz > 0: # <<<<<<<<<<<<<<
24217 : * astart_ptr = &astart[0]
24218 : * aindex_ptr = &aindex[0]
24219 : */
24220 950 : goto __pyx_L6;
24221 : }
24222 :
24223 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":631
24224 : * lp.a_matrix_.value_.assign(avalue_ptr, avalue_ptr + numnz)
24225 : * else:
24226 : * lp.a_matrix_.start_.empty() # <<<<<<<<<<<<<<
24227 : * lp.a_matrix_.index_.empty()
24228 : * lp.a_matrix_.value_.empty()
24229 : */
24230 : /*else*/ {
24231 : (void)(__pyx_v_lp.a_matrix_.start_.empty());
24232 :
24233 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":632
24234 : * else:
24235 : * lp.a_matrix_.start_.empty()
24236 : * lp.a_matrix_.index_.empty() # <<<<<<<<<<<<<<
24237 : * lp.a_matrix_.value_.empty()
24238 : *
24239 : */
24240 : (void)(__pyx_v_lp.a_matrix_.index_.empty());
24241 :
24242 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":633
24243 : * lp.a_matrix_.start_.empty()
24244 : * lp.a_matrix_.index_.empty()
24245 : * lp.a_matrix_.value_.empty() # <<<<<<<<<<<<<<
24246 : *
24247 : * # Create the options
24248 : */
24249 : (void)(__pyx_v_lp.a_matrix_.value_.empty());
24250 : }
24251 1001 : __pyx_L6:;
24252 :
24253 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":637
24254 : * # Create the options
24255 : * cdef Highs highs
24256 : * apply_options(options, highs) # <<<<<<<<<<<<<<
24257 : *
24258 : * # Make a Highs object and pass it everything
24259 : */
24260 1001 : __pyx_f_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_apply_options(__pyx_v_options, __pyx_v_highs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 637, __pyx_L1_error)
24261 :
24262 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":640
24263 : *
24264 : * # Make a Highs object and pass it everything
24265 : * cdef HighsModelStatus err_model_status = HighsModelStatusNOTSET # <<<<<<<<<<<<<<
24266 : * cdef HighsStatus init_status = highs.passModel(lp)
24267 : * if init_status != HighsStatusOK:
24268 : */
24269 1001 : __pyx_v_err_model_status = HighsModelStatus::kNotset;
24270 :
24271 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":641
24272 : * # Make a Highs object and pass it everything
24273 : * cdef HighsModelStatus err_model_status = HighsModelStatusNOTSET
24274 : * cdef HighsStatus init_status = highs.passModel(lp) # <<<<<<<<<<<<<<
24275 : * if init_status != HighsStatusOK:
24276 : * if init_status != HighsStatusWarning:
24277 : */
24278 1001 : __pyx_v_init_status = __pyx_v_highs.passModel(__pyx_v_lp);
24279 :
24280 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":642
24281 : * cdef HighsModelStatus err_model_status = HighsModelStatusNOTSET
24282 : * cdef HighsStatus init_status = highs.passModel(lp)
24283 : * if init_status != HighsStatusOK: # <<<<<<<<<<<<<<
24284 : * if init_status != HighsStatusWarning:
24285 : * err_model_status = HighsModelStatusMODEL_ERROR
24286 : */
24287 1001 : __pyx_t_4 = (__pyx_v_init_status != HighsStatus::kOk);
24288 1001 : if (__pyx_t_4) {
24289 :
24290 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":643
24291 : * cdef HighsStatus init_status = highs.passModel(lp)
24292 : * if init_status != HighsStatusOK:
24293 : * if init_status != HighsStatusWarning: # <<<<<<<<<<<<<<
24294 : * err_model_status = HighsModelStatusMODEL_ERROR
24295 : * return {
24296 : */
24297 12 : __pyx_t_4 = (__pyx_v_init_status != HighsStatus::kWarning);
24298 12 : if (__pyx_t_4) {
24299 :
24300 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":644
24301 : * if init_status != HighsStatusOK:
24302 : * if init_status != HighsStatusWarning:
24303 : * err_model_status = HighsModelStatusMODEL_ERROR # <<<<<<<<<<<<<<
24304 : * return {
24305 : * 'status': <int> err_model_status,
24306 : */
24307 4 : __pyx_v_err_model_status = HighsModelStatus::kModelError;
24308 :
24309 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":645
24310 : * if init_status != HighsStatusWarning:
24311 : * err_model_status = HighsModelStatusMODEL_ERROR
24312 : * return { # <<<<<<<<<<<<<<
24313 : * 'status': <int> err_model_status,
24314 : * 'message': highs.modelStatusToString(err_model_status).decode(),
24315 : */
24316 4 : __Pyx_XDECREF(__pyx_r);
24317 :
24318 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":646
24319 : * err_model_status = HighsModelStatusMODEL_ERROR
24320 : * return {
24321 : * 'status': <int> err_model_status, # <<<<<<<<<<<<<<
24322 : * 'message': highs.modelStatusToString(err_model_status).decode(),
24323 : * }
24324 : */
24325 4 : __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
24326 4 : __Pyx_GOTREF(__pyx_t_1);
24327 4 : __pyx_t_2 = __Pyx_PyInt_From_int(((int)__pyx_v_err_model_status)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
24328 4 : __Pyx_GOTREF(__pyx_t_2);
24329 4 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_t_2) < 0) __PYX_ERR(0, 646, __pyx_L1_error)
24330 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24331 :
24332 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":647
24333 : * return {
24334 : * 'status': <int> err_model_status,
24335 : * 'message': highs.modelStatusToString(err_model_status).decode(), # <<<<<<<<<<<<<<
24336 : * }
24337 : *
24338 : */
24339 8 : __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_highs.modelStatusToString(__pyx_v_err_model_status), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
24340 4 : __Pyx_GOTREF(__pyx_t_2);
24341 4 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_message, __pyx_t_2) < 0) __PYX_ERR(0, 646, __pyx_L1_error)
24342 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24343 4 : __pyx_r = __pyx_t_1;
24344 4 : __pyx_t_1 = 0;
24345 4 : goto __pyx_L0;
24346 :
24347 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":643
24348 : * cdef HighsStatus init_status = highs.passModel(lp)
24349 : * if init_status != HighsStatusOK:
24350 : * if init_status != HighsStatusWarning: # <<<<<<<<<<<<<<
24351 : * err_model_status = HighsModelStatusMODEL_ERROR
24352 : * return {
24353 : */
24354 : }
24355 :
24356 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":642
24357 : * cdef HighsModelStatus err_model_status = HighsModelStatusNOTSET
24358 : * cdef HighsStatus init_status = highs.passModel(lp)
24359 : * if init_status != HighsStatusOK: # <<<<<<<<<<<<<<
24360 : * if init_status != HighsStatusWarning:
24361 : * err_model_status = HighsModelStatusMODEL_ERROR
24362 : */
24363 : }
24364 :
24365 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":651
24366 : *
24367 : * # Solve the LP
24368 : * cdef HighsStatus run_status = highs.run() # <<<<<<<<<<<<<<
24369 : * if run_status == HighsStatusError:
24370 : * return {
24371 : */
24372 997 : __pyx_v_run_status = __pyx_v_highs.run();
24373 :
24374 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":652
24375 : * # Solve the LP
24376 : * cdef HighsStatus run_status = highs.run()
24377 : * if run_status == HighsStatusError: # <<<<<<<<<<<<<<
24378 : * return {
24379 : * 'status': <int> highs.getModelStatus(),
24380 : */
24381 997 : __pyx_t_4 = (__pyx_v_run_status == HighsStatus::kError);
24382 997 : if (__pyx_t_4) {
24383 :
24384 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":653
24385 : * cdef HighsStatus run_status = highs.run()
24386 : * if run_status == HighsStatusError:
24387 : * return { # <<<<<<<<<<<<<<
24388 : * 'status': <int> highs.getModelStatus(),
24389 : * 'message': highsStatusToString(run_status).decode(),
24390 : */
24391 0 : __Pyx_XDECREF(__pyx_r);
24392 :
24393 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":654
24394 : * if run_status == HighsStatusError:
24395 : * return {
24396 : * 'status': <int> highs.getModelStatus(), # <<<<<<<<<<<<<<
24397 : * 'message': highsStatusToString(run_status).decode(),
24398 : * }
24399 : */
24400 0 : __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
24401 0 : __Pyx_GOTREF(__pyx_t_1);
24402 0 : __pyx_t_2 = __Pyx_PyInt_From_int(((int)__pyx_v_highs.getModelStatus())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
24403 0 : __Pyx_GOTREF(__pyx_t_2);
24404 0 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_t_2) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
24405 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24406 :
24407 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":655
24408 : * return {
24409 : * 'status': <int> highs.getModelStatus(),
24410 : * 'message': highsStatusToString(run_status).decode(), # <<<<<<<<<<<<<<
24411 : * }
24412 : *
24413 : */
24414 0 : __pyx_t_2 = __Pyx_decode_cpp_string(highsStatusToString(__pyx_v_run_status), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
24415 0 : __Pyx_GOTREF(__pyx_t_2);
24416 0 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_message, __pyx_t_2) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
24417 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24418 0 : __pyx_r = __pyx_t_1;
24419 0 : __pyx_t_1 = 0;
24420 0 : goto __pyx_L0;
24421 :
24422 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":652
24423 : * # Solve the LP
24424 : * cdef HighsStatus run_status = highs.run()
24425 : * if run_status == HighsStatusError: # <<<<<<<<<<<<<<
24426 : * return {
24427 : * 'status': <int> highs.getModelStatus(),
24428 : */
24429 : }
24430 :
24431 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":659
24432 : *
24433 : * # Extract what we need from the solution
24434 : * cdef HighsModelStatus model_status = highs.getModelStatus() # <<<<<<<<<<<<<<
24435 : *
24436 : * # We might need an info object if we can look up the solution and a place to put solution
24437 : */
24438 997 : __pyx_v_model_status = __pyx_v_highs.getModelStatus();
24439 :
24440 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":662
24441 : *
24442 : * # We might need an info object if we can look up the solution and a place to put solution
24443 : * cdef HighsInfo info = highs.getHighsInfo() # it should always be safe to get the info object # <<<<<<<<<<<<<<
24444 : * cdef HighsSolution solution
24445 : * cdef HighsBasis basis
24446 : */
24447 997 : __pyx_v_info = __pyx_v_highs.getInfo();
24448 :
24449 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":665
24450 : * cdef HighsSolution solution
24451 : * cdef HighsBasis basis
24452 : * cdef double[:, ::1] marg_bnds = np.zeros((2, numcol)) # marg_bnds[0, :]: lower # <<<<<<<<<<<<<<
24453 : *
24454 : * # Failure modes:
24455 : */
24456 997 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
24457 997 : __Pyx_GOTREF(__pyx_t_2);
24458 997 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
24459 997 : __Pyx_GOTREF(__pyx_t_6);
24460 997 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24461 997 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_numcol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
24462 997 : __Pyx_GOTREF(__pyx_t_2);
24463 997 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 665, __pyx_L1_error)
24464 997 : __Pyx_GOTREF(__pyx_t_7);
24465 997 : __Pyx_INCREF(__pyx_int_2);
24466 997 : __Pyx_GIVEREF(__pyx_int_2);
24467 997 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_2)) __PYX_ERR(0, 665, __pyx_L1_error);
24468 997 : __Pyx_GIVEREF(__pyx_t_2);
24469 997 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error);
24470 997 : __pyx_t_2 = 0;
24471 997 : __pyx_t_2 = NULL;
24472 997 : __pyx_t_8 = 0;
24473 : #if CYTHON_UNPACK_METHODS
24474 997 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
24475 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
24476 0 : if (likely(__pyx_t_2)) {
24477 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
24478 0 : __Pyx_INCREF(__pyx_t_2);
24479 0 : __Pyx_INCREF(function);
24480 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
24481 : __pyx_t_8 = 1;
24482 : }
24483 : }
24484 : #endif
24485 997 : {
24486 997 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
24487 997 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
24488 997 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24489 997 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24490 997 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
24491 997 : __Pyx_GOTREF(__pyx_t_1);
24492 997 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24493 : }
24494 997 : __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 665, __pyx_L1_error)
24495 997 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24496 997 : __pyx_v_marg_bnds = __pyx_t_9;
24497 997 : __pyx_t_9.memview = NULL;
24498 997 : __pyx_t_9.data = NULL;
24499 :
24500 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":676
24501 : * # current solution is feasible and can be returned. Else, there
24502 : * # is no solution.
24503 : * mipFailCondition = model_status not in { # <<<<<<<<<<<<<<
24504 : * HighsModelStatusOPTIMAL,
24505 : * HighsModelStatusREACHED_TIME_LIMIT,
24506 : */
24507 997 : switch (__pyx_v_model_status) {
24508 : case HighsModelStatus::kOptimal:
24509 :
24510 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":677
24511 : * # is no solution.
24512 : * mipFailCondition = model_status not in {
24513 : * HighsModelStatusOPTIMAL, # <<<<<<<<<<<<<<
24514 : * HighsModelStatusREACHED_TIME_LIMIT,
24515 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24516 : */
24517 : case HighsModelStatus::kTimeLimit:
24518 :
24519 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":678
24520 : * mipFailCondition = model_status not in {
24521 : * HighsModelStatusOPTIMAL,
24522 : * HighsModelStatusREACHED_TIME_LIMIT, # <<<<<<<<<<<<<<
24523 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24524 : * } or (model_status in {
24525 : */
24526 : case HighsModelStatus::kIterationLimit:
24527 :
24528 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":676
24529 : * # current solution is feasible and can be returned. Else, there
24530 : * # is no solution.
24531 : * mipFailCondition = model_status not in { # <<<<<<<<<<<<<<
24532 : * HighsModelStatusOPTIMAL,
24533 : * HighsModelStatusREACHED_TIME_LIMIT,
24534 : */
24535 : __pyx_t_4 = 0;
24536 : break;
24537 49 : default:
24538 49 : __pyx_t_4 = 1;
24539 49 : break;
24540 : }
24541 997 : __pyx_t_10 = __pyx_t_4;
24542 997 : if (!__pyx_t_10) {
24543 : } else {
24544 49 : __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
24545 49 : __Pyx_GOTREF(__pyx_t_6);
24546 49 : __pyx_t_1 = __pyx_t_6;
24547 49 : __pyx_t_6 = 0;
24548 49 : goto __pyx_L10_bool_binop_done;
24549 : }
24550 :
24551 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":680
24552 : * HighsModelStatusREACHED_TIME_LIMIT,
24553 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24554 : * } or (model_status in { # <<<<<<<<<<<<<<
24555 : * HighsModelStatusREACHED_TIME_LIMIT,
24556 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24557 : */
24558 948 : switch (__pyx_v_model_status) {
24559 : case HighsModelStatus::kTimeLimit:
24560 :
24561 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":681
24562 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24563 : * } or (model_status in {
24564 : * HighsModelStatusREACHED_TIME_LIMIT, # <<<<<<<<<<<<<<
24565 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24566 : * } and (info.objective_function_value == HIGHS_CONST_INF))
24567 : */
24568 : case HighsModelStatus::kIterationLimit:
24569 :
24570 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":680
24571 : * HighsModelStatusREACHED_TIME_LIMIT,
24572 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24573 : * } or (model_status in { # <<<<<<<<<<<<<<
24574 : * HighsModelStatusREACHED_TIME_LIMIT,
24575 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24576 : */
24577 : __pyx_t_10 = 1;
24578 : break;
24579 943 : default:
24580 943 : __pyx_t_10 = 0;
24581 943 : break;
24582 : }
24583 948 : __pyx_t_4 = __pyx_t_10;
24584 948 : if (__pyx_t_4) {
24585 : } else {
24586 943 : __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error)
24587 943 : __Pyx_GOTREF(__pyx_t_6);
24588 943 : __pyx_t_1 = __pyx_t_6;
24589 943 : __pyx_t_6 = 0;
24590 943 : goto __pyx_L10_bool_binop_done;
24591 : }
24592 :
24593 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":683
24594 : * HighsModelStatusREACHED_TIME_LIMIT,
24595 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24596 : * } and (info.objective_function_value == HIGHS_CONST_INF)) # <<<<<<<<<<<<<<
24597 : * lpFailCondition = model_status != HighsModelStatusOPTIMAL
24598 : * if (highs.getLp().isMip() and mipFailCondition) or (not highs.getLp().isMip() and lpFailCondition):
24599 : */
24600 5 : __pyx_t_4 = (__pyx_v_info.objective_function_value == kHighsInf);
24601 5 : __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error)
24602 : __Pyx_GOTREF(__pyx_t_6);
24603 : __pyx_t_1 = __pyx_t_6;
24604 : __pyx_t_6 = 0;
24605 997 : __pyx_L10_bool_binop_done:;
24606 997 : __pyx_v_mipFailCondition = __pyx_t_1;
24607 997 : __pyx_t_1 = 0;
24608 :
24609 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":684
24610 : * HighsModelStatusREACHED_ITERATION_LIMIT,
24611 : * } and (info.objective_function_value == HIGHS_CONST_INF))
24612 : * lpFailCondition = model_status != HighsModelStatusOPTIMAL # <<<<<<<<<<<<<<
24613 : * if (highs.getLp().isMip() and mipFailCondition) or (not highs.getLp().isMip() and lpFailCondition):
24614 : * return {
24615 : */
24616 997 : __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_model_status != HighsModelStatus::kOptimal)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
24617 997 : __Pyx_GOTREF(__pyx_t_1);
24618 997 : __pyx_v_lpFailCondition = __pyx_t_1;
24619 997 : __pyx_t_1 = 0;
24620 :
24621 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":685
24622 : * } and (info.objective_function_value == HIGHS_CONST_INF))
24623 : * lpFailCondition = model_status != HighsModelStatusOPTIMAL
24624 : * if (highs.getLp().isMip() and mipFailCondition) or (not highs.getLp().isMip() and lpFailCondition): # <<<<<<<<<<<<<<
24625 : * return {
24626 : * 'status': <int> model_status,
24627 : */
24628 997 : __pyx_t_10 = (__pyx_v_highs.getLp().isMip() != 0);
24629 997 : if (!__pyx_t_10) {
24630 975 : goto __pyx_L15_next_or;
24631 : } else {
24632 : }
24633 22 : __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_mipFailCondition); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 685, __pyx_L1_error)
24634 22 : if (!__pyx_t_10) {
24635 : } else {
24636 3 : __pyx_t_4 = __pyx_t_10;
24637 3 : goto __pyx_L14_bool_binop_done;
24638 : }
24639 994 : __pyx_L15_next_or:;
24640 994 : __pyx_t_10 = (!(__pyx_v_highs.getLp().isMip() != 0));
24641 994 : if (__pyx_t_10) {
24642 : } else {
24643 19 : __pyx_t_4 = __pyx_t_10;
24644 19 : goto __pyx_L14_bool_binop_done;
24645 : }
24646 975 : __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_lpFailCondition); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 685, __pyx_L1_error)
24647 : __pyx_t_4 = __pyx_t_10;
24648 997 : __pyx_L14_bool_binop_done:;
24649 997 : if (__pyx_t_4) {
24650 :
24651 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":686
24652 : * lpFailCondition = model_status != HighsModelStatusOPTIMAL
24653 : * if (highs.getLp().isMip() and mipFailCondition) or (not highs.getLp().isMip() and lpFailCondition):
24654 : * return { # <<<<<<<<<<<<<<
24655 : * 'status': <int> model_status,
24656 : * 'message': f'model_status is {highs.modelStatusToString(model_status).decode()}; '
24657 : */
24658 54 : __Pyx_XDECREF(__pyx_r);
24659 :
24660 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":687
24661 : * if (highs.getLp().isMip() and mipFailCondition) or (not highs.getLp().isMip() and lpFailCondition):
24662 : * return {
24663 : * 'status': <int> model_status, # <<<<<<<<<<<<<<
24664 : * 'message': f'model_status is {highs.modelStatusToString(model_status).decode()}; '
24665 : * f'primal_status is {utilBasisStatusToString(<HighsBasisStatus> info.primal_solution_status).decode()}',
24666 : */
24667 54 : __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
24668 54 : __Pyx_GOTREF(__pyx_t_1);
24669 54 : __pyx_t_6 = __Pyx_PyInt_From_int(((int)__pyx_v_model_status)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error)
24670 54 : __Pyx_GOTREF(__pyx_t_6);
24671 54 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_t_6) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
24672 54 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24673 :
24674 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":688
24675 : * return {
24676 : * 'status': <int> model_status,
24677 : * 'message': f'model_status is {highs.modelStatusToString(model_status).decode()}; ' # <<<<<<<<<<<<<<
24678 : * f'primal_status is {utilBasisStatusToString(<HighsBasisStatus> info.primal_solution_status).decode()}',
24679 : * 'simplex_nit': info.simplex_iteration_count,
24680 : */
24681 54 : __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error)
24682 54 : __Pyx_GOTREF(__pyx_t_6);
24683 54 : __pyx_t_11 = 0;
24684 54 : __pyx_t_12 = 127;
24685 54 : __Pyx_INCREF(__pyx_kp_u_model_status_is);
24686 54 : __pyx_t_11 += 16;
24687 54 : __Pyx_GIVEREF(__pyx_kp_u_model_status_is);
24688 54 : PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_model_status_is);
24689 108 : __pyx_t_7 = __Pyx_decode_cpp_string(__pyx_v_highs.modelStatusToString(__pyx_v_model_status), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
24690 54 : __Pyx_GOTREF(__pyx_t_7);
24691 54 : __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12;
24692 54 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
24693 54 : __Pyx_GIVEREF(__pyx_t_7);
24694 54 : PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
24695 54 : __pyx_t_7 = 0;
24696 54 : __Pyx_INCREF(__pyx_kp_u_primal_status_is);
24697 54 : __pyx_t_11 += 19;
24698 54 : __Pyx_GIVEREF(__pyx_kp_u_primal_status_is);
24699 54 : PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_primal_status_is);
24700 :
24701 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":689
24702 : * 'status': <int> model_status,
24703 : * 'message': f'model_status is {highs.modelStatusToString(model_status).decode()}; '
24704 : * f'primal_status is {utilBasisStatusToString(<HighsBasisStatus> info.primal_solution_status).decode()}', # <<<<<<<<<<<<<<
24705 : * 'simplex_nit': info.simplex_iteration_count,
24706 : * 'ipm_nit': info.ipm_iteration_count,
24707 : */
24708 108 : __pyx_t_7 = __Pyx_decode_cpp_string(utilBasisStatusToString(((enum HighsBasisStatus)__pyx_v_info.primal_solution_status)), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
24709 54 : __Pyx_GOTREF(__pyx_t_7);
24710 54 : __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12;
24711 54 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
24712 54 : __Pyx_GIVEREF(__pyx_t_7);
24713 54 : PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_7);
24714 54 : __pyx_t_7 = 0;
24715 :
24716 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":688
24717 : * return {
24718 : * 'status': <int> model_status,
24719 : * 'message': f'model_status is {highs.modelStatusToString(model_status).decode()}; ' # <<<<<<<<<<<<<<
24720 : * f'primal_status is {utilBasisStatusToString(<HighsBasisStatus> info.primal_solution_status).decode()}',
24721 : * 'simplex_nit': info.simplex_iteration_count,
24722 : */
24723 54 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
24724 54 : __Pyx_GOTREF(__pyx_t_7);
24725 54 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24726 54 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_message, __pyx_t_7) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
24727 54 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24728 :
24729 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":690
24730 : * 'message': f'model_status is {highs.modelStatusToString(model_status).decode()}; '
24731 : * f'primal_status is {utilBasisStatusToString(<HighsBasisStatus> info.primal_solution_status).decode()}',
24732 : * 'simplex_nit': info.simplex_iteration_count, # <<<<<<<<<<<<<<
24733 : * 'ipm_nit': info.ipm_iteration_count,
24734 : * 'fun': None,
24735 : */
24736 54 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.simplex_iteration_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error)
24737 54 : __Pyx_GOTREF(__pyx_t_7);
24738 54 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_simplex_nit, __pyx_t_7) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
24739 54 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24740 :
24741 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":691
24742 : * f'primal_status is {utilBasisStatusToString(<HighsBasisStatus> info.primal_solution_status).decode()}',
24743 : * 'simplex_nit': info.simplex_iteration_count,
24744 : * 'ipm_nit': info.ipm_iteration_count, # <<<<<<<<<<<<<<
24745 : * 'fun': None,
24746 : * 'crossover_nit': info.crossover_iteration_count,
24747 : */
24748 54 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.ipm_iteration_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
24749 54 : __Pyx_GOTREF(__pyx_t_7);
24750 54 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ipm_nit, __pyx_t_7) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
24751 54 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24752 :
24753 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":692
24754 : * 'simplex_nit': info.simplex_iteration_count,
24755 : * 'ipm_nit': info.ipm_iteration_count,
24756 : * 'fun': None, # <<<<<<<<<<<<<<
24757 : * 'crossover_nit': info.crossover_iteration_count,
24758 : * }
24759 : */
24760 54 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_fun, Py_None) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
24761 :
24762 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":693
24763 : * 'ipm_nit': info.ipm_iteration_count,
24764 : * 'fun': None,
24765 : * 'crossover_nit': info.crossover_iteration_count, # <<<<<<<<<<<<<<
24766 : * }
24767 : * # If the model status is such that the solution can be read
24768 : */
24769 54 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.crossover_iteration_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 693, __pyx_L1_error)
24770 54 : __Pyx_GOTREF(__pyx_t_7);
24771 54 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_crossover_nit, __pyx_t_7) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
24772 54 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24773 54 : __pyx_r = __pyx_t_1;
24774 54 : __pyx_t_1 = 0;
24775 54 : goto __pyx_L0;
24776 :
24777 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":685
24778 : * } and (info.objective_function_value == HIGHS_CONST_INF))
24779 : * lpFailCondition = model_status != HighsModelStatusOPTIMAL
24780 : * if (highs.getLp().isMip() and mipFailCondition) or (not highs.getLp().isMip() and lpFailCondition): # <<<<<<<<<<<<<<
24781 : * return {
24782 : * 'status': <int> model_status,
24783 : */
24784 : }
24785 :
24786 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":698
24787 : * else:
24788 : * # Should be safe to read the solution:
24789 : * solution = highs.getSolution() # <<<<<<<<<<<<<<
24790 : * basis = highs.getBasis()
24791 : *
24792 : */
24793 943 : /*else*/ {
24794 943 : __pyx_v_solution = __pyx_v_highs.getSolution();
24795 :
24796 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":699
24797 : * # Should be safe to read the solution:
24798 : * solution = highs.getSolution()
24799 : * basis = highs.getBasis() # <<<<<<<<<<<<<<
24800 : *
24801 : * # lagrangians for bounds based on column statuses
24802 : */
24803 943 : __pyx_v_basis = __pyx_v_highs.getBasis();
24804 :
24805 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":702
24806 : *
24807 : * # lagrangians for bounds based on column statuses
24808 : * for ii in range(numcol): # <<<<<<<<<<<<<<
24809 : * if HighsBasisStatusLOWER == basis.col_status[ii]:
24810 : * marg_bnds[0, ii] = solution.col_dual[ii]
24811 : */
24812 39650 : __pyx_t_3 = __pyx_v_numcol;
24813 : __pyx_t_13 = __pyx_t_3;
24814 39650 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
24815 38707 : __pyx_v_ii = __pyx_t_14;
24816 :
24817 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":703
24818 : * # lagrangians for bounds based on column statuses
24819 : * for ii in range(numcol):
24820 : * if HighsBasisStatusLOWER == basis.col_status[ii]: # <<<<<<<<<<<<<<
24821 : * marg_bnds[0, ii] = solution.col_dual[ii]
24822 : * elif HighsBasisStatusUPPER == basis.col_status[ii]:
24823 : */
24824 38707 : __pyx_t_4 = (HighsBasisStatus::kLower == (__pyx_v_basis.col_status[__pyx_v_ii]));
24825 38707 : if (__pyx_t_4) {
24826 :
24827 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":704
24828 : * for ii in range(numcol):
24829 : * if HighsBasisStatusLOWER == basis.col_status[ii]:
24830 : * marg_bnds[0, ii] = solution.col_dual[ii] # <<<<<<<<<<<<<<
24831 : * elif HighsBasisStatusUPPER == basis.col_status[ii]:
24832 : * marg_bnds[1, ii] = solution.col_dual[ii]
24833 : */
24834 8020 : __pyx_t_5 = 0;
24835 8020 : __pyx_t_15 = __pyx_v_ii;
24836 8020 : __pyx_t_16 = -1;
24837 8020 : if (__pyx_t_5 < 0) {
24838 : __pyx_t_5 += __pyx_v_marg_bnds.shape[0];
24839 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_16 = 0;
24840 8020 : } else if (unlikely(__pyx_t_5 >= __pyx_v_marg_bnds.shape[0])) __pyx_t_16 = 0;
24841 8020 : if (__pyx_t_15 < 0) {
24842 : __pyx_t_15 += __pyx_v_marg_bnds.shape[1];
24843 : if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
24844 8020 : } else if (unlikely(__pyx_t_15 >= __pyx_v_marg_bnds.shape[1])) __pyx_t_16 = 1;
24845 8020 : if (unlikely(__pyx_t_16 != -1)) {
24846 0 : __Pyx_RaiseBufferIndexError(__pyx_t_16);
24847 0 : __PYX_ERR(0, 704, __pyx_L1_error)
24848 : }
24849 8020 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_marg_bnds.data + __pyx_t_5 * __pyx_v_marg_bnds.strides[0]) )) + __pyx_t_15)) )) = (__pyx_v_solution.col_dual[__pyx_v_ii]);
24850 :
24851 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":703
24852 : * # lagrangians for bounds based on column statuses
24853 : * for ii in range(numcol):
24854 : * if HighsBasisStatusLOWER == basis.col_status[ii]: # <<<<<<<<<<<<<<
24855 : * marg_bnds[0, ii] = solution.col_dual[ii]
24856 : * elif HighsBasisStatusUPPER == basis.col_status[ii]:
24857 : */
24858 8020 : goto __pyx_L20;
24859 : }
24860 :
24861 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":705
24862 : * if HighsBasisStatusLOWER == basis.col_status[ii]:
24863 : * marg_bnds[0, ii] = solution.col_dual[ii]
24864 : * elif HighsBasisStatusUPPER == basis.col_status[ii]: # <<<<<<<<<<<<<<
24865 : * marg_bnds[1, ii] = solution.col_dual[ii]
24866 : *
24867 : */
24868 30687 : __pyx_t_4 = (HighsBasisStatus::kUpper == (__pyx_v_basis.col_status[__pyx_v_ii]));
24869 30687 : if (__pyx_t_4) {
24870 :
24871 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":706
24872 : * marg_bnds[0, ii] = solution.col_dual[ii]
24873 : * elif HighsBasisStatusUPPER == basis.col_status[ii]:
24874 : * marg_bnds[1, ii] = solution.col_dual[ii] # <<<<<<<<<<<<<<
24875 : *
24876 : * res = {
24877 : */
24878 11693 : __pyx_t_15 = 1;
24879 11693 : __pyx_t_5 = __pyx_v_ii;
24880 11693 : __pyx_t_16 = -1;
24881 11693 : if (__pyx_t_15 < 0) {
24882 : __pyx_t_15 += __pyx_v_marg_bnds.shape[0];
24883 : if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
24884 11693 : } else if (unlikely(__pyx_t_15 >= __pyx_v_marg_bnds.shape[0])) __pyx_t_16 = 0;
24885 11693 : if (__pyx_t_5 < 0) {
24886 : __pyx_t_5 += __pyx_v_marg_bnds.shape[1];
24887 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_16 = 1;
24888 11693 : } else if (unlikely(__pyx_t_5 >= __pyx_v_marg_bnds.shape[1])) __pyx_t_16 = 1;
24889 11693 : if (unlikely(__pyx_t_16 != -1)) {
24890 0 : __Pyx_RaiseBufferIndexError(__pyx_t_16);
24891 0 : __PYX_ERR(0, 706, __pyx_L1_error)
24892 : }
24893 11693 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_marg_bnds.data + __pyx_t_15 * __pyx_v_marg_bnds.strides[0]) )) + __pyx_t_5)) )) = (__pyx_v_solution.col_dual[__pyx_v_ii]);
24894 :
24895 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":705
24896 : * if HighsBasisStatusLOWER == basis.col_status[ii]:
24897 : * marg_bnds[0, ii] = solution.col_dual[ii]
24898 : * elif HighsBasisStatusUPPER == basis.col_status[ii]: # <<<<<<<<<<<<<<
24899 : * marg_bnds[1, ii] = solution.col_dual[ii]
24900 : *
24901 : */
24902 : }
24903 38707 : __pyx_L20:;
24904 : }
24905 :
24906 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":709
24907 : *
24908 : * res = {
24909 : * 'status': <int> model_status, # <<<<<<<<<<<<<<
24910 : * 'message': highs.modelStatusToString(model_status).decode(),
24911 : *
24912 : */
24913 943 : __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
24914 943 : __Pyx_GOTREF(__pyx_t_1);
24915 943 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)__pyx_v_model_status)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 709, __pyx_L1_error)
24916 943 : __Pyx_GOTREF(__pyx_t_7);
24917 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_status, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
24918 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24919 :
24920 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":710
24921 : * res = {
24922 : * 'status': <int> model_status,
24923 : * 'message': highs.modelStatusToString(model_status).decode(), # <<<<<<<<<<<<<<
24924 : *
24925 : * # Primal solution
24926 : */
24927 1886 : __pyx_t_7 = __Pyx_decode_cpp_string(__pyx_v_highs.modelStatusToString(__pyx_v_model_status), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 710, __pyx_L1_error)
24928 943 : __Pyx_GOTREF(__pyx_t_7);
24929 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_message, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
24930 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24931 943 : { /* enter inner scope */
24932 :
24933 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":713
24934 : *
24935 : * # Primal solution
24936 : * 'x': [solution.col_value[ii] for ii in range(numcol)], # <<<<<<<<<<<<<<
24937 : *
24938 : * # Ax + s = b => Ax = b - s
24939 : */
24940 943 : __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 713, __pyx_L1_error)
24941 : __Pyx_GOTREF(__pyx_t_7);
24942 39650 : __pyx_t_3 = __pyx_v_numcol;
24943 : __pyx_t_13 = __pyx_t_3;
24944 39650 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
24945 38707 : __pyx_7genexpr__pyx_v_ii = __pyx_t_14;
24946 38707 : __pyx_t_6 = PyFloat_FromDouble((__pyx_v_solution.col_value[__pyx_7genexpr__pyx_v_ii])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error)
24947 38707 : __Pyx_GOTREF(__pyx_t_6);
24948 38707 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 713, __pyx_L1_error)
24949 77414 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24950 : }
24951 : } /* exit inner scope */
24952 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_x, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
24953 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24954 943 : { /* enter inner scope */
24955 :
24956 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":717
24957 : * # Ax + s = b => Ax = b - s
24958 : * # Note: this is for all constraints (A_ub and A_eq)
24959 : * 'slack': [rhs[ii] - solution.row_value[ii] for ii in range(numrow)], # <<<<<<<<<<<<<<
24960 : *
24961 : * # lambda are the lagrange multipliers associated with Ax=b
24962 : */
24963 943 : __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 717, __pyx_L1_error)
24964 : __Pyx_GOTREF(__pyx_t_7);
24965 113361 : __pyx_t_3 = __pyx_v_numrow;
24966 : __pyx_t_13 = __pyx_t_3;
24967 113361 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
24968 112418 : __pyx_8genexpr1__pyx_v_ii = __pyx_t_14;
24969 112418 : __pyx_t_5 = __pyx_8genexpr1__pyx_v_ii;
24970 112418 : __pyx_t_16 = -1;
24971 112418 : if (__pyx_t_5 < 0) {
24972 : __pyx_t_5 += __pyx_v_rhs.shape[0];
24973 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_16 = 0;
24974 112418 : } else if (unlikely(__pyx_t_5 >= __pyx_v_rhs.shape[0])) __pyx_t_16 = 0;
24975 112418 : if (unlikely(__pyx_t_16 != -1)) {
24976 0 : __Pyx_RaiseBufferIndexError(__pyx_t_16);
24977 0 : __PYX_ERR(0, 717, __pyx_L1_error)
24978 : }
24979 112418 : __pyx_t_6 = PyFloat_FromDouble(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_rhs.data) + __pyx_t_5)) ))) - (__pyx_v_solution.row_value[__pyx_8genexpr1__pyx_v_ii]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error)
24980 112418 : __Pyx_GOTREF(__pyx_t_6);
24981 112418 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 717, __pyx_L1_error)
24982 224836 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24983 : }
24984 : } /* exit inner scope */
24985 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slack, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
24986 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24987 943 : { /* enter inner scope */
24988 :
24989 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":720
24990 : *
24991 : * # lambda are the lagrange multipliers associated with Ax=b
24992 : * 'lambda': [solution.row_dual[ii] for ii in range(numrow)], # <<<<<<<<<<<<<<
24993 : * 'marg_bnds': marg_bnds,
24994 : *
24995 : */
24996 943 : __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error)
24997 : __Pyx_GOTREF(__pyx_t_7);
24998 113361 : __pyx_t_3 = __pyx_v_numrow;
24999 : __pyx_t_13 = __pyx_t_3;
25000 113361 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25001 112418 : __pyx_8genexpr2__pyx_v_ii = __pyx_t_14;
25002 112418 : __pyx_t_6 = PyFloat_FromDouble((__pyx_v_solution.row_dual[__pyx_8genexpr2__pyx_v_ii])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 720, __pyx_L1_error)
25003 112418 : __Pyx_GOTREF(__pyx_t_6);
25004 112418 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 720, __pyx_L1_error)
25005 224836 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25006 : }
25007 : } /* exit inner scope */
25008 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lambda, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
25009 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25010 :
25011 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":721
25012 : * # lambda are the lagrange multipliers associated with Ax=b
25013 : * 'lambda': [solution.row_dual[ii] for ii in range(numrow)],
25014 : * 'marg_bnds': marg_bnds, # <<<<<<<<<<<<<<
25015 : *
25016 : * 'fun': info.objective_function_value,
25017 : */
25018 943 : __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_marg_bnds, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 721, __pyx_L1_error)
25019 943 : __Pyx_GOTREF(__pyx_t_7);
25020 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_marg_bnds, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
25021 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25022 :
25023 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":723
25024 : * 'marg_bnds': marg_bnds,
25025 : *
25026 : * 'fun': info.objective_function_value, # <<<<<<<<<<<<<<
25027 : * 'simplex_nit': info.simplex_iteration_count,
25028 : * 'ipm_nit': info.ipm_iteration_count,
25029 : */
25030 943 : __pyx_t_7 = PyFloat_FromDouble(__pyx_v_info.objective_function_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error)
25031 943 : __Pyx_GOTREF(__pyx_t_7);
25032 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_fun, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
25033 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25034 :
25035 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":724
25036 : *
25037 : * 'fun': info.objective_function_value,
25038 : * 'simplex_nit': info.simplex_iteration_count, # <<<<<<<<<<<<<<
25039 : * 'ipm_nit': info.ipm_iteration_count,
25040 : * 'crossover_nit': info.crossover_iteration_count,
25041 : */
25042 943 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.simplex_iteration_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error)
25043 943 : __Pyx_GOTREF(__pyx_t_7);
25044 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_simplex_nit, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
25045 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25046 :
25047 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":725
25048 : * 'fun': info.objective_function_value,
25049 : * 'simplex_nit': info.simplex_iteration_count,
25050 : * 'ipm_nit': info.ipm_iteration_count, # <<<<<<<<<<<<<<
25051 : * 'crossover_nit': info.crossover_iteration_count,
25052 : * }
25053 : */
25054 943 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.ipm_iteration_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 725, __pyx_L1_error)
25055 943 : __Pyx_GOTREF(__pyx_t_7);
25056 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ipm_nit, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
25057 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25058 :
25059 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":726
25060 : * 'simplex_nit': info.simplex_iteration_count,
25061 : * 'ipm_nit': info.ipm_iteration_count,
25062 : * 'crossover_nit': info.crossover_iteration_count, # <<<<<<<<<<<<<<
25063 : * }
25064 : *
25065 : */
25066 943 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.crossover_iteration_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error)
25067 943 : __Pyx_GOTREF(__pyx_t_7);
25068 943 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_crossover_nit, __pyx_t_7) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
25069 943 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25070 943 : __pyx_v_res = ((PyObject*)__pyx_t_1);
25071 943 : __pyx_t_1 = 0;
25072 :
25073 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":729
25074 : * }
25075 : *
25076 : * if highs.getLp().isMip(): # <<<<<<<<<<<<<<
25077 : * res.update({
25078 : * 'mip_node_count': info.mip_node_count,
25079 : */
25080 943 : __pyx_t_4 = (__pyx_v_highs.getLp().isMip() != 0);
25081 943 : if (__pyx_t_4) {
25082 :
25083 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":731
25084 : * if highs.getLp().isMip():
25085 : * res.update({
25086 : * 'mip_node_count': info.mip_node_count, # <<<<<<<<<<<<<<
25087 : * 'mip_dual_bound': info.mip_dual_bound,
25088 : * 'mip_gap': info.mip_gap,
25089 : */
25090 19 : __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
25091 19 : __Pyx_GOTREF(__pyx_t_1);
25092 19 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_info.mip_node_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error)
25093 19 : __Pyx_GOTREF(__pyx_t_7);
25094 19 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mip_node_count, __pyx_t_7) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
25095 19 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25096 :
25097 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":732
25098 : * res.update({
25099 : * 'mip_node_count': info.mip_node_count,
25100 : * 'mip_dual_bound': info.mip_dual_bound, # <<<<<<<<<<<<<<
25101 : * 'mip_gap': info.mip_gap,
25102 : * })
25103 : */
25104 19 : __pyx_t_7 = PyFloat_FromDouble(__pyx_v_info.mip_dual_bound); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error)
25105 19 : __Pyx_GOTREF(__pyx_t_7);
25106 19 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mip_dual_bound, __pyx_t_7) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
25107 19 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25108 :
25109 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":733
25110 : * 'mip_node_count': info.mip_node_count,
25111 : * 'mip_dual_bound': info.mip_dual_bound,
25112 : * 'mip_gap': info.mip_gap, # <<<<<<<<<<<<<<
25113 : * })
25114 : *
25115 : */
25116 19 : __pyx_t_7 = PyFloat_FromDouble(__pyx_v_info.mip_gap); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error)
25117 19 : __Pyx_GOTREF(__pyx_t_7);
25118 19 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mip_gap, __pyx_t_7) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
25119 19 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25120 :
25121 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":730
25122 : *
25123 : * if highs.getLp().isMip():
25124 : * res.update({ # <<<<<<<<<<<<<<
25125 : * 'mip_node_count': info.mip_node_count,
25126 : * 'mip_dual_bound': info.mip_dual_bound,
25127 : */
25128 19 : __pyx_t_7 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_res, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
25129 19 : __Pyx_GOTREF(__pyx_t_7);
25130 19 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25131 19 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25132 :
25133 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":729
25134 : * }
25135 : *
25136 : * if highs.getLp().isMip(): # <<<<<<<<<<<<<<
25137 : * res.update({
25138 : * 'mip_node_count': info.mip_node_count,
25139 : */
25140 : }
25141 :
25142 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":736
25143 : * })
25144 : *
25145 : * return res # <<<<<<<<<<<<<<
25146 : */
25147 943 : __Pyx_XDECREF(__pyx_r);
25148 943 : __Pyx_INCREF(__pyx_v_res);
25149 943 : __pyx_r = __pyx_v_res;
25150 943 : goto __pyx_L0;
25151 : }
25152 :
25153 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":238
25154 : *
25155 : *
25156 : * def _highs_wrapper( # <<<<<<<<<<<<<<
25157 : * double[::1] c,
25158 : * int[::1] astart,
25159 : */
25160 :
25161 : /* function exit code */
25162 0 : __pyx_L1_error:;
25163 0 : __Pyx_XDECREF(__pyx_t_1);
25164 0 : __Pyx_XDECREF(__pyx_t_2);
25165 0 : __Pyx_XDECREF(__pyx_t_6);
25166 0 : __Pyx_XDECREF(__pyx_t_7);
25167 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
25168 0 : __Pyx_AddTraceback("scipy.optimize._highs.cython.src._highs_wrapper._highs_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
25169 : __pyx_r = NULL;
25170 1001 : __pyx_L0:;
25171 1001 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_marg_bnds, 1);
25172 1001 : __Pyx_XDECREF(__pyx_v_mipFailCondition);
25173 1001 : __Pyx_XDECREF(__pyx_v_lpFailCondition);
25174 1001 : __Pyx_XDECREF(__pyx_v_res);
25175 1001 : __Pyx_XGIVEREF(__pyx_r);
25176 1001 : __Pyx_RefNannyFinishContext();
25177 1001 : return __pyx_r;
25178 1001 : }
25179 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
25180 :
25181 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25182 0 : struct __pyx_array_obj *p;
25183 0 : PyObject *o;
25184 : #if CYTHON_COMPILING_IN_LIMITED_API
25185 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25186 : o = alloc_func(t, 0);
25187 : #else
25188 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25189 0 : o = (*t->tp_alloc)(t, 0);
25190 : } else {
25191 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25192 : }
25193 0 : if (unlikely(!o)) return 0;
25194 : #endif
25195 0 : p = ((struct __pyx_array_obj *)o);
25196 0 : p->__pyx_vtab = __pyx_vtabptr_array;
25197 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25198 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25199 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25200 : return o;
25201 0 : bad:
25202 0 : Py_DECREF(o); o = 0;
25203 : return NULL;
25204 : }
25205 :
25206 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
25207 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25208 : #if CYTHON_USE_TP_FINALIZE
25209 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25210 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25211 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25212 : }
25213 : }
25214 : #endif
25215 0 : {
25216 0 : PyObject *etype, *eval, *etb;
25217 0 : PyErr_Fetch(&etype, &eval, &etb);
25218 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25219 0 : __pyx_array___dealloc__(o);
25220 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25221 0 : PyErr_Restore(etype, eval, etb);
25222 : }
25223 0 : Py_CLEAR(p->mode);
25224 0 : Py_CLEAR(p->_format);
25225 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25226 0 : (*Py_TYPE(o)->tp_free)(o);
25227 : #else
25228 : {
25229 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25230 : if (tp_free) tp_free(o);
25231 : }
25232 : #endif
25233 : }
25234 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25235 0 : PyObject *r;
25236 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25237 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25238 0 : Py_DECREF(x);
25239 : return r;
25240 : }
25241 :
25242 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25243 0 : if (v) {
25244 0 : return __pyx_array___setitem__(o, i, v);
25245 : }
25246 : else {
25247 0 : __Pyx_TypeName o_type_name;
25248 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25249 0 : PyErr_Format(PyExc_NotImplementedError,
25250 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25251 0 : __Pyx_DECREF_TypeName(o_type_name);
25252 0 : return -1;
25253 : }
25254 : }
25255 :
25256 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25257 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25258 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25259 0 : PyErr_Clear();
25260 0 : v = __pyx_array___getattr__(o, n);
25261 : }
25262 0 : return v;
25263 : }
25264 :
25265 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25266 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25267 : }
25268 :
25269 : static PyMethodDef __pyx_methods_array[] = {
25270 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25271 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25272 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25273 : {0, 0, 0, 0}
25274 : };
25275 :
25276 : static struct PyGetSetDef __pyx_getsets_array[] = {
25277 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25278 : {0, 0, 0, 0, 0}
25279 : };
25280 : #if CYTHON_USE_TYPE_SPECS
25281 : #if !CYTHON_COMPILING_IN_LIMITED_API
25282 :
25283 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25284 : #if PY_MAJOR_VERSION < 3
25285 : 0, /*bf_getreadbuffer*/
25286 : #endif
25287 : #if PY_MAJOR_VERSION < 3
25288 : 0, /*bf_getwritebuffer*/
25289 : #endif
25290 : #if PY_MAJOR_VERSION < 3
25291 : 0, /*bf_getsegcount*/
25292 : #endif
25293 : #if PY_MAJOR_VERSION < 3
25294 : 0, /*bf_getcharbuffer*/
25295 : #endif
25296 : __pyx_array_getbuffer, /*bf_getbuffer*/
25297 : 0, /*bf_releasebuffer*/
25298 : };
25299 : #endif
25300 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
25301 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
25302 : {Py_sq_length, (void *)__pyx_array___len__},
25303 : {Py_sq_item, (void *)__pyx_sq_item_array},
25304 : {Py_mp_length, (void *)__pyx_array___len__},
25305 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
25306 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
25307 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
25308 : #if defined(Py_bf_getbuffer)
25309 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
25310 : #endif
25311 : {Py_tp_methods, (void *)__pyx_methods_array},
25312 : {Py_tp_getset, (void *)__pyx_getsets_array},
25313 : {Py_tp_new, (void *)__pyx_tp_new_array},
25314 : {0, 0},
25315 : };
25316 : static PyType_Spec __pyx_type___pyx_array_spec = {
25317 : "scipy.optimize._highs.cython.src._highs_wrapper.array",
25318 : sizeof(struct __pyx_array_obj),
25319 : 0,
25320 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25321 : __pyx_type___pyx_array_slots,
25322 : };
25323 : #else
25324 :
25325 : static PySequenceMethods __pyx_tp_as_sequence_array = {
25326 : __pyx_array___len__, /*sq_length*/
25327 : 0, /*sq_concat*/
25328 : 0, /*sq_repeat*/
25329 : __pyx_sq_item_array, /*sq_item*/
25330 : 0, /*sq_slice*/
25331 : 0, /*sq_ass_item*/
25332 : 0, /*sq_ass_slice*/
25333 : 0, /*sq_contains*/
25334 : 0, /*sq_inplace_concat*/
25335 : 0, /*sq_inplace_repeat*/
25336 : };
25337 :
25338 : static PyMappingMethods __pyx_tp_as_mapping_array = {
25339 : __pyx_array___len__, /*mp_length*/
25340 : __pyx_array___getitem__, /*mp_subscript*/
25341 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25342 : };
25343 :
25344 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25345 : #if PY_MAJOR_VERSION < 3
25346 : 0, /*bf_getreadbuffer*/
25347 : #endif
25348 : #if PY_MAJOR_VERSION < 3
25349 : 0, /*bf_getwritebuffer*/
25350 : #endif
25351 : #if PY_MAJOR_VERSION < 3
25352 : 0, /*bf_getsegcount*/
25353 : #endif
25354 : #if PY_MAJOR_VERSION < 3
25355 : 0, /*bf_getcharbuffer*/
25356 : #endif
25357 : __pyx_array_getbuffer, /*bf_getbuffer*/
25358 : 0, /*bf_releasebuffer*/
25359 : };
25360 :
25361 : static PyTypeObject __pyx_type___pyx_array = {
25362 : PyVarObject_HEAD_INIT(0, 0)
25363 : "scipy.optimize._highs.cython.src._highs_wrapper.""array", /*tp_name*/
25364 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25365 : 0, /*tp_itemsize*/
25366 : __pyx_tp_dealloc_array, /*tp_dealloc*/
25367 : #if PY_VERSION_HEX < 0x030800b4
25368 : 0, /*tp_print*/
25369 : #endif
25370 : #if PY_VERSION_HEX >= 0x030800b4
25371 : 0, /*tp_vectorcall_offset*/
25372 : #endif
25373 : 0, /*tp_getattr*/
25374 : 0, /*tp_setattr*/
25375 : #if PY_MAJOR_VERSION < 3
25376 : 0, /*tp_compare*/
25377 : #endif
25378 : #if PY_MAJOR_VERSION >= 3
25379 : 0, /*tp_as_async*/
25380 : #endif
25381 : 0, /*tp_repr*/
25382 : 0, /*tp_as_number*/
25383 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25384 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25385 : 0, /*tp_hash*/
25386 : 0, /*tp_call*/
25387 : 0, /*tp_str*/
25388 : __pyx_tp_getattro_array, /*tp_getattro*/
25389 : 0, /*tp_setattro*/
25390 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25391 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
25392 : 0, /*tp_doc*/
25393 : 0, /*tp_traverse*/
25394 : 0, /*tp_clear*/
25395 : 0, /*tp_richcompare*/
25396 : 0, /*tp_weaklistoffset*/
25397 : 0, /*tp_iter*/
25398 : 0, /*tp_iternext*/
25399 : __pyx_methods_array, /*tp_methods*/
25400 : 0, /*tp_members*/
25401 : __pyx_getsets_array, /*tp_getset*/
25402 : 0, /*tp_base*/
25403 : 0, /*tp_dict*/
25404 : 0, /*tp_descr_get*/
25405 : 0, /*tp_descr_set*/
25406 : #if !CYTHON_USE_TYPE_SPECS
25407 : 0, /*tp_dictoffset*/
25408 : #endif
25409 : 0, /*tp_init*/
25410 : 0, /*tp_alloc*/
25411 : __pyx_tp_new_array, /*tp_new*/
25412 : 0, /*tp_free*/
25413 : 0, /*tp_is_gc*/
25414 : 0, /*tp_bases*/
25415 : 0, /*tp_mro*/
25416 : 0, /*tp_cache*/
25417 : 0, /*tp_subclasses*/
25418 : 0, /*tp_weaklist*/
25419 : 0, /*tp_del*/
25420 : 0, /*tp_version_tag*/
25421 : #if PY_VERSION_HEX >= 0x030400a1
25422 : #if CYTHON_USE_TP_FINALIZE
25423 : 0, /*tp_finalize*/
25424 : #else
25425 : NULL, /*tp_finalize*/
25426 : #endif
25427 : #endif
25428 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25429 : 0, /*tp_vectorcall*/
25430 : #endif
25431 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25432 : 0, /*tp_print*/
25433 : #endif
25434 : #if PY_VERSION_HEX >= 0x030C0000
25435 : 0, /*tp_watched*/
25436 : #endif
25437 : #if PY_VERSION_HEX >= 0x030d00A4
25438 : 0, /*tp_versions_used*/
25439 : #endif
25440 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25441 : 0, /*tp_pypy_flags*/
25442 : #endif
25443 : };
25444 : #endif
25445 :
25446 5 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25447 5 : struct __pyx_MemviewEnum_obj *p;
25448 5 : PyObject *o;
25449 : #if CYTHON_COMPILING_IN_LIMITED_API
25450 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25451 : o = alloc_func(t, 0);
25452 : #else
25453 5 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25454 5 : o = (*t->tp_alloc)(t, 0);
25455 : } else {
25456 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25457 : }
25458 5 : if (unlikely(!o)) return 0;
25459 : #endif
25460 5 : p = ((struct __pyx_MemviewEnum_obj *)o);
25461 5 : p->name = Py_None; Py_INCREF(Py_None);
25462 : return o;
25463 : }
25464 :
25465 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
25466 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25467 : #if CYTHON_USE_TP_FINALIZE
25468 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25469 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
25470 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25471 : }
25472 : }
25473 : #endif
25474 0 : PyObject_GC_UnTrack(o);
25475 0 : Py_CLEAR(p->name);
25476 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25477 0 : (*Py_TYPE(o)->tp_free)(o);
25478 : #else
25479 : {
25480 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25481 : if (tp_free) tp_free(o);
25482 : }
25483 : #endif
25484 : }
25485 :
25486 285 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25487 285 : int e;
25488 285 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25489 285 : if (p->name) {
25490 285 : e = (*v)(p->name, a); if (e) return e;
25491 : }
25492 : return 0;
25493 : }
25494 :
25495 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
25496 0 : PyObject* tmp;
25497 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25498 0 : tmp = ((PyObject*)p->name);
25499 0 : p->name = Py_None; Py_INCREF(Py_None);
25500 0 : Py_XDECREF(tmp);
25501 0 : return 0;
25502 : }
25503 :
25504 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
25505 0 : return __pyx_MemviewEnum___repr__(self);
25506 : }
25507 :
25508 : static PyMethodDef __pyx_methods_Enum[] = {
25509 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
25510 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25511 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25512 : {0, 0, 0, 0}
25513 : };
25514 : #if CYTHON_USE_TYPE_SPECS
25515 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
25516 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
25517 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
25518 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
25519 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
25520 : {Py_tp_methods, (void *)__pyx_methods_Enum},
25521 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
25522 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
25523 : {0, 0},
25524 : };
25525 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
25526 : "scipy.optimize._highs.cython.src._highs_wrapper.Enum",
25527 : sizeof(struct __pyx_MemviewEnum_obj),
25528 : 0,
25529 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25530 : __pyx_type___pyx_MemviewEnum_slots,
25531 : };
25532 : #else
25533 :
25534 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25535 : PyVarObject_HEAD_INIT(0, 0)
25536 : "scipy.optimize._highs.cython.src._highs_wrapper.""Enum", /*tp_name*/
25537 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25538 : 0, /*tp_itemsize*/
25539 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25540 : #if PY_VERSION_HEX < 0x030800b4
25541 : 0, /*tp_print*/
25542 : #endif
25543 : #if PY_VERSION_HEX >= 0x030800b4
25544 : 0, /*tp_vectorcall_offset*/
25545 : #endif
25546 : 0, /*tp_getattr*/
25547 : 0, /*tp_setattr*/
25548 : #if PY_MAJOR_VERSION < 3
25549 : 0, /*tp_compare*/
25550 : #endif
25551 : #if PY_MAJOR_VERSION >= 3
25552 : 0, /*tp_as_async*/
25553 : #endif
25554 : __pyx_MemviewEnum___repr__, /*tp_repr*/
25555 : 0, /*tp_as_number*/
25556 : 0, /*tp_as_sequence*/
25557 : 0, /*tp_as_mapping*/
25558 : 0, /*tp_hash*/
25559 : 0, /*tp_call*/
25560 : 0, /*tp_str*/
25561 : 0, /*tp_getattro*/
25562 : 0, /*tp_setattro*/
25563 : 0, /*tp_as_buffer*/
25564 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25565 : 0, /*tp_doc*/
25566 : __pyx_tp_traverse_Enum, /*tp_traverse*/
25567 : __pyx_tp_clear_Enum, /*tp_clear*/
25568 : 0, /*tp_richcompare*/
25569 : 0, /*tp_weaklistoffset*/
25570 : 0, /*tp_iter*/
25571 : 0, /*tp_iternext*/
25572 : __pyx_methods_Enum, /*tp_methods*/
25573 : 0, /*tp_members*/
25574 : 0, /*tp_getset*/
25575 : 0, /*tp_base*/
25576 : 0, /*tp_dict*/
25577 : 0, /*tp_descr_get*/
25578 : 0, /*tp_descr_set*/
25579 : #if !CYTHON_USE_TYPE_SPECS
25580 : 0, /*tp_dictoffset*/
25581 : #endif
25582 : __pyx_MemviewEnum___init__, /*tp_init*/
25583 : 0, /*tp_alloc*/
25584 : __pyx_tp_new_Enum, /*tp_new*/
25585 : 0, /*tp_free*/
25586 : 0, /*tp_is_gc*/
25587 : 0, /*tp_bases*/
25588 : 0, /*tp_mro*/
25589 : 0, /*tp_cache*/
25590 : 0, /*tp_subclasses*/
25591 : 0, /*tp_weaklist*/
25592 : 0, /*tp_del*/
25593 : 0, /*tp_version_tag*/
25594 : #if PY_VERSION_HEX >= 0x030400a1
25595 : #if CYTHON_USE_TP_FINALIZE
25596 : 0, /*tp_finalize*/
25597 : #else
25598 : NULL, /*tp_finalize*/
25599 : #endif
25600 : #endif
25601 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25602 : 0, /*tp_vectorcall*/
25603 : #endif
25604 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25605 : 0, /*tp_print*/
25606 : #endif
25607 : #if PY_VERSION_HEX >= 0x030C0000
25608 : 0, /*tp_watched*/
25609 : #endif
25610 : #if PY_VERSION_HEX >= 0x030d00A4
25611 : 0, /*tp_versions_used*/
25612 : #endif
25613 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25614 : 0, /*tp_pypy_flags*/
25615 : #endif
25616 : };
25617 : #endif
25618 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25619 :
25620 16351 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25621 16351 : struct __pyx_memoryview_obj *p;
25622 16351 : PyObject *o;
25623 : #if CYTHON_COMPILING_IN_LIMITED_API
25624 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25625 : o = alloc_func(t, 0);
25626 : #else
25627 16351 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25628 16351 : o = (*t->tp_alloc)(t, 0);
25629 : } else {
25630 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25631 : }
25632 16351 : if (unlikely(!o)) return 0;
25633 : #endif
25634 16351 : p = ((struct __pyx_memoryview_obj *)o);
25635 16351 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
25636 16351 : p->obj = Py_None; Py_INCREF(Py_None);
25637 16351 : p->_size = Py_None; Py_INCREF(Py_None);
25638 16351 : p->_array_interface = Py_None; Py_INCREF(Py_None);
25639 16351 : p->view.obj = NULL;
25640 16351 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
25641 : return o;
25642 0 : bad:
25643 0 : Py_DECREF(o); o = 0;
25644 : return NULL;
25645 : }
25646 :
25647 16351 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25648 16351 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25649 : #if CYTHON_USE_TP_FINALIZE
25650 16351 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25651 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
25652 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25653 : }
25654 : }
25655 : #endif
25656 16351 : PyObject_GC_UnTrack(o);
25657 16351 : {
25658 16351 : PyObject *etype, *eval, *etb;
25659 16351 : PyErr_Fetch(&etype, &eval, &etb);
25660 16351 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25661 16351 : __pyx_memoryview___dealloc__(o);
25662 16351 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25663 16351 : PyErr_Restore(etype, eval, etb);
25664 : }
25665 16351 : Py_CLEAR(p->obj);
25666 16351 : Py_CLEAR(p->_size);
25667 16351 : Py_CLEAR(p->_array_interface);
25668 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25669 16351 : (*Py_TYPE(o)->tp_free)(o);
25670 : #else
25671 : {
25672 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25673 : if (tp_free) tp_free(o);
25674 : }
25675 : #endif
25676 : }
25677 :
25678 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
25679 0 : int e;
25680 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25681 0 : if (p->obj) {
25682 0 : e = (*v)(p->obj, a); if (e) return e;
25683 : }
25684 0 : if (p->_size) {
25685 0 : e = (*v)(p->_size, a); if (e) return e;
25686 : }
25687 0 : if (p->_array_interface) {
25688 0 : e = (*v)(p->_array_interface, a); if (e) return e;
25689 : }
25690 0 : if (p->view.obj) {
25691 0 : e = (*v)(p->view.obj, a); if (e) return e;
25692 : }
25693 : return 0;
25694 : }
25695 :
25696 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
25697 0 : PyObject* tmp;
25698 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25699 0 : tmp = ((PyObject*)p->obj);
25700 0 : p->obj = Py_None; Py_INCREF(Py_None);
25701 0 : Py_XDECREF(tmp);
25702 0 : tmp = ((PyObject*)p->_size);
25703 0 : p->_size = Py_None; Py_INCREF(Py_None);
25704 0 : Py_XDECREF(tmp);
25705 0 : tmp = ((PyObject*)p->_array_interface);
25706 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
25707 0 : Py_XDECREF(tmp);
25708 0 : Py_CLEAR(p->view.obj);
25709 0 : return 0;
25710 : }
25711 0 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
25712 0 : PyObject *r;
25713 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25714 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25715 0 : Py_DECREF(x);
25716 : return r;
25717 : }
25718 :
25719 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
25720 0 : if (v) {
25721 0 : return __pyx_memoryview___setitem__(o, i, v);
25722 : }
25723 : else {
25724 0 : __Pyx_TypeName o_type_name;
25725 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25726 0 : PyErr_Format(PyExc_NotImplementedError,
25727 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25728 0 : __Pyx_DECREF_TypeName(o_type_name);
25729 0 : return -1;
25730 : }
25731 : }
25732 :
25733 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
25734 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
25735 : }
25736 :
25737 0 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
25738 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
25739 : }
25740 :
25741 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
25742 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
25743 : }
25744 :
25745 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
25746 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
25747 : }
25748 :
25749 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
25750 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
25751 : }
25752 :
25753 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
25754 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
25755 : }
25756 :
25757 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
25758 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
25759 : }
25760 :
25761 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
25762 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
25763 : }
25764 :
25765 4004 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
25766 4004 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
25767 : }
25768 :
25769 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
25770 0 : return __pyx_memoryview___repr__(self);
25771 : }
25772 :
25773 : static PyMethodDef __pyx_methods_memoryview[] = {
25774 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
25775 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25776 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25777 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25778 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25779 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25780 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25781 : {0, 0, 0, 0}
25782 : };
25783 :
25784 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
25785 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
25786 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
25787 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
25788 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
25789 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
25790 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
25791 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
25792 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
25793 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
25794 : {0, 0, 0, 0, 0}
25795 : };
25796 : #if CYTHON_USE_TYPE_SPECS
25797 : #if !CYTHON_COMPILING_IN_LIMITED_API
25798 :
25799 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25800 : #if PY_MAJOR_VERSION < 3
25801 : 0, /*bf_getreadbuffer*/
25802 : #endif
25803 : #if PY_MAJOR_VERSION < 3
25804 : 0, /*bf_getwritebuffer*/
25805 : #endif
25806 : #if PY_MAJOR_VERSION < 3
25807 : 0, /*bf_getsegcount*/
25808 : #endif
25809 : #if PY_MAJOR_VERSION < 3
25810 : 0, /*bf_getcharbuffer*/
25811 : #endif
25812 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25813 : 0, /*bf_releasebuffer*/
25814 : };
25815 : #endif
25816 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
25817 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
25818 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
25819 : {Py_sq_length, (void *)__pyx_memoryview___len__},
25820 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
25821 : {Py_mp_length, (void *)__pyx_memoryview___len__},
25822 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
25823 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
25824 : {Py_tp_str, (void *)__pyx_memoryview___str__},
25825 : #if defined(Py_bf_getbuffer)
25826 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
25827 : #endif
25828 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
25829 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
25830 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
25831 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
25832 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
25833 : {0, 0},
25834 : };
25835 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
25836 : "scipy.optimize._highs.cython.src._highs_wrapper.memoryview",
25837 : sizeof(struct __pyx_memoryview_obj),
25838 : 0,
25839 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25840 : __pyx_type___pyx_memoryview_slots,
25841 : };
25842 : #else
25843 :
25844 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
25845 : __pyx_memoryview___len__, /*sq_length*/
25846 : 0, /*sq_concat*/
25847 : 0, /*sq_repeat*/
25848 : __pyx_sq_item_memoryview, /*sq_item*/
25849 : 0, /*sq_slice*/
25850 : 0, /*sq_ass_item*/
25851 : 0, /*sq_ass_slice*/
25852 : 0, /*sq_contains*/
25853 : 0, /*sq_inplace_concat*/
25854 : 0, /*sq_inplace_repeat*/
25855 : };
25856 :
25857 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
25858 : __pyx_memoryview___len__, /*mp_length*/
25859 : __pyx_memoryview___getitem__, /*mp_subscript*/
25860 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
25861 : };
25862 :
25863 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25864 : #if PY_MAJOR_VERSION < 3
25865 : 0, /*bf_getreadbuffer*/
25866 : #endif
25867 : #if PY_MAJOR_VERSION < 3
25868 : 0, /*bf_getwritebuffer*/
25869 : #endif
25870 : #if PY_MAJOR_VERSION < 3
25871 : 0, /*bf_getsegcount*/
25872 : #endif
25873 : #if PY_MAJOR_VERSION < 3
25874 : 0, /*bf_getcharbuffer*/
25875 : #endif
25876 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25877 : 0, /*bf_releasebuffer*/
25878 : };
25879 :
25880 : static PyTypeObject __pyx_type___pyx_memoryview = {
25881 : PyVarObject_HEAD_INIT(0, 0)
25882 : "scipy.optimize._highs.cython.src._highs_wrapper.""memoryview", /*tp_name*/
25883 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
25884 : 0, /*tp_itemsize*/
25885 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
25886 : #if PY_VERSION_HEX < 0x030800b4
25887 : 0, /*tp_print*/
25888 : #endif
25889 : #if PY_VERSION_HEX >= 0x030800b4
25890 : 0, /*tp_vectorcall_offset*/
25891 : #endif
25892 : 0, /*tp_getattr*/
25893 : 0, /*tp_setattr*/
25894 : #if PY_MAJOR_VERSION < 3
25895 : 0, /*tp_compare*/
25896 : #endif
25897 : #if PY_MAJOR_VERSION >= 3
25898 : 0, /*tp_as_async*/
25899 : #endif
25900 : __pyx_memoryview___repr__, /*tp_repr*/
25901 : 0, /*tp_as_number*/
25902 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
25903 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
25904 : 0, /*tp_hash*/
25905 : 0, /*tp_call*/
25906 : __pyx_memoryview___str__, /*tp_str*/
25907 : 0, /*tp_getattro*/
25908 : 0, /*tp_setattro*/
25909 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
25910 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25911 : 0, /*tp_doc*/
25912 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
25913 : __pyx_tp_clear_memoryview, /*tp_clear*/
25914 : 0, /*tp_richcompare*/
25915 : 0, /*tp_weaklistoffset*/
25916 : 0, /*tp_iter*/
25917 : 0, /*tp_iternext*/
25918 : __pyx_methods_memoryview, /*tp_methods*/
25919 : 0, /*tp_members*/
25920 : __pyx_getsets_memoryview, /*tp_getset*/
25921 : 0, /*tp_base*/
25922 : 0, /*tp_dict*/
25923 : 0, /*tp_descr_get*/
25924 : 0, /*tp_descr_set*/
25925 : #if !CYTHON_USE_TYPE_SPECS
25926 : 0, /*tp_dictoffset*/
25927 : #endif
25928 : 0, /*tp_init*/
25929 : 0, /*tp_alloc*/
25930 : __pyx_tp_new_memoryview, /*tp_new*/
25931 : 0, /*tp_free*/
25932 : 0, /*tp_is_gc*/
25933 : 0, /*tp_bases*/
25934 : 0, /*tp_mro*/
25935 : 0, /*tp_cache*/
25936 : 0, /*tp_subclasses*/
25937 : 0, /*tp_weaklist*/
25938 : 0, /*tp_del*/
25939 : 0, /*tp_version_tag*/
25940 : #if PY_VERSION_HEX >= 0x030400a1
25941 : #if CYTHON_USE_TP_FINALIZE
25942 : 0, /*tp_finalize*/
25943 : #else
25944 : NULL, /*tp_finalize*/
25945 : #endif
25946 : #endif
25947 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25948 : 0, /*tp_vectorcall*/
25949 : #endif
25950 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25951 : 0, /*tp_print*/
25952 : #endif
25953 : #if PY_VERSION_HEX >= 0x030C0000
25954 : 0, /*tp_watched*/
25955 : #endif
25956 : #if PY_VERSION_HEX >= 0x030d00A4
25957 : 0, /*tp_versions_used*/
25958 : #endif
25959 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25960 : 0, /*tp_pypy_flags*/
25961 : #endif
25962 : };
25963 : #endif
25964 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
25965 :
25966 6345 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
25967 6345 : struct __pyx_memoryviewslice_obj *p;
25968 6345 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
25969 6345 : if (unlikely(!o)) return 0;
25970 6345 : p = ((struct __pyx_memoryviewslice_obj *)o);
25971 6345 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
25972 6345 : new((void*)&(p->from_slice)) __Pyx_memviewslice();
25973 6345 : p->from_object = Py_None; Py_INCREF(Py_None);
25974 6345 : p->from_slice.memview = NULL;
25975 6345 : return o;
25976 : }
25977 :
25978 6345 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
25979 6345 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25980 : #if CYTHON_USE_TP_FINALIZE
25981 6345 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25982 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
25983 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25984 : }
25985 : }
25986 : #endif
25987 6345 : PyObject_GC_UnTrack(o);
25988 6345 : {
25989 6345 : PyObject *etype, *eval, *etb;
25990 6345 : PyErr_Fetch(&etype, &eval, &etb);
25991 6345 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25992 6345 : __pyx_memoryviewslice___dealloc__(o);
25993 6345 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25994 6345 : PyErr_Restore(etype, eval, etb);
25995 : }
25996 6345 : __Pyx_call_destructor(p->from_slice);
25997 6345 : Py_CLEAR(p->from_object);
25998 6345 : PyObject_GC_Track(o);
25999 6345 : __pyx_tp_dealloc_memoryview(o);
26000 : }
26001 :
26002 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26003 0 : int e;
26004 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26005 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26006 0 : if (p->from_object) {
26007 0 : e = (*v)(p->from_object, a); if (e) return e;
26008 : }
26009 : return 0;
26010 : }
26011 :
26012 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26013 0 : PyObject* tmp;
26014 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26015 0 : __pyx_tp_clear_memoryview(o);
26016 0 : tmp = ((PyObject*)p->from_object);
26017 0 : p->from_object = Py_None; Py_INCREF(Py_None);
26018 0 : Py_XDECREF(tmp);
26019 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
26020 0 : return 0;
26021 : }
26022 :
26023 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
26024 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26025 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26026 : {0, 0, 0, 0}
26027 : };
26028 : #if CYTHON_USE_TYPE_SPECS
26029 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
26030 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
26031 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
26032 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
26033 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
26034 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
26035 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
26036 : {0, 0},
26037 : };
26038 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
26039 : "scipy.optimize._highs.cython.src._highs_wrapper._memoryviewslice",
26040 : sizeof(struct __pyx_memoryviewslice_obj),
26041 : 0,
26042 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26043 : __pyx_type___pyx_memoryviewslice_slots,
26044 : };
26045 : #else
26046 :
26047 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26048 : PyVarObject_HEAD_INIT(0, 0)
26049 : "scipy.optimize._highs.cython.src._highs_wrapper.""_memoryviewslice", /*tp_name*/
26050 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26051 : 0, /*tp_itemsize*/
26052 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26053 : #if PY_VERSION_HEX < 0x030800b4
26054 : 0, /*tp_print*/
26055 : #endif
26056 : #if PY_VERSION_HEX >= 0x030800b4
26057 : 0, /*tp_vectorcall_offset*/
26058 : #endif
26059 : 0, /*tp_getattr*/
26060 : 0, /*tp_setattr*/
26061 : #if PY_MAJOR_VERSION < 3
26062 : 0, /*tp_compare*/
26063 : #endif
26064 : #if PY_MAJOR_VERSION >= 3
26065 : 0, /*tp_as_async*/
26066 : #endif
26067 : #if CYTHON_COMPILING_IN_PYPY || 0
26068 : __pyx_memoryview___repr__, /*tp_repr*/
26069 : #else
26070 : 0, /*tp_repr*/
26071 : #endif
26072 : 0, /*tp_as_number*/
26073 : 0, /*tp_as_sequence*/
26074 : 0, /*tp_as_mapping*/
26075 : 0, /*tp_hash*/
26076 : 0, /*tp_call*/
26077 : #if CYTHON_COMPILING_IN_PYPY || 0
26078 : __pyx_memoryview___str__, /*tp_str*/
26079 : #else
26080 : 0, /*tp_str*/
26081 : #endif
26082 : 0, /*tp_getattro*/
26083 : 0, /*tp_setattro*/
26084 : 0, /*tp_as_buffer*/
26085 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26086 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
26087 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26088 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26089 : 0, /*tp_richcompare*/
26090 : 0, /*tp_weaklistoffset*/
26091 : 0, /*tp_iter*/
26092 : 0, /*tp_iternext*/
26093 : __pyx_methods__memoryviewslice, /*tp_methods*/
26094 : 0, /*tp_members*/
26095 : 0, /*tp_getset*/
26096 : 0, /*tp_base*/
26097 : 0, /*tp_dict*/
26098 : 0, /*tp_descr_get*/
26099 : 0, /*tp_descr_set*/
26100 : #if !CYTHON_USE_TYPE_SPECS
26101 : 0, /*tp_dictoffset*/
26102 : #endif
26103 : 0, /*tp_init*/
26104 : 0, /*tp_alloc*/
26105 : __pyx_tp_new__memoryviewslice, /*tp_new*/
26106 : 0, /*tp_free*/
26107 : 0, /*tp_is_gc*/
26108 : 0, /*tp_bases*/
26109 : 0, /*tp_mro*/
26110 : 0, /*tp_cache*/
26111 : 0, /*tp_subclasses*/
26112 : 0, /*tp_weaklist*/
26113 : 0, /*tp_del*/
26114 : 0, /*tp_version_tag*/
26115 : #if PY_VERSION_HEX >= 0x030400a1
26116 : #if CYTHON_USE_TP_FINALIZE
26117 : 0, /*tp_finalize*/
26118 : #else
26119 : NULL, /*tp_finalize*/
26120 : #endif
26121 : #endif
26122 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26123 : 0, /*tp_vectorcall*/
26124 : #endif
26125 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26126 : 0, /*tp_print*/
26127 : #endif
26128 : #if PY_VERSION_HEX >= 0x030C0000
26129 : 0, /*tp_watched*/
26130 : #endif
26131 : #if PY_VERSION_HEX >= 0x030d00A4
26132 : 0, /*tp_versions_used*/
26133 : #endif
26134 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26135 : 0, /*tp_pypy_flags*/
26136 : #endif
26137 : };
26138 : #endif
26139 :
26140 : static PyMethodDef __pyx_methods[] = {
26141 : {0, 0, 0, 0}
26142 : };
26143 : #ifndef CYTHON_SMALL_CODE
26144 : #if defined(__clang__)
26145 : #define CYTHON_SMALL_CODE
26146 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26147 : #define CYTHON_SMALL_CODE __attribute__((cold))
26148 : #else
26149 : #define CYTHON_SMALL_CODE
26150 : #endif
26151 : #endif
26152 : /* #### Code section: pystring_table ### */
26153 :
26154 1 : static int __Pyx_CreateStringTabAndInitStrings(void) {
26155 1 : __Pyx_StringTabEntry __pyx_string_tab[] = {
26156 1 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
26157 1 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26158 1 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
26159 1 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
26160 1 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26161 1 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26162 1 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26163 1 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26164 1 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
26165 1 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
26166 1 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
26167 1 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26168 1 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26169 1 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
26170 1 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
26171 1 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26172 1 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
26173 1 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26174 1 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
26175 1 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
26176 1 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26177 1 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26178 1 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26179 1 : {&__pyx_n_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1},
26180 1 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26181 1 : {&__pyx_n_s_OptimizeWarning, __pyx_k_OptimizeWarning, sizeof(__pyx_k_OptimizeWarning), 0, 0, 1, 1},
26182 1 : {&__pyx_kp_u_Option, __pyx_k_Option, sizeof(__pyx_k_Option), 0, 1, 0, 0},
26183 1 : {&__pyx_kp_u_Option_s_is_s_but_only_values_in, __pyx_k_Option_s_is_s_but_only_values_in, sizeof(__pyx_k_Option_s_is_s_but_only_values_in), 0, 1, 0, 0},
26184 1 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
26185 1 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26186 1 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
26187 1 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
26188 1 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26189 1 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26190 1 : {&__pyx_kp_u_Using_default, __pyx_k_Using_default, sizeof(__pyx_k_Using_default), 0, 1, 0, 0},
26191 1 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26192 1 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26193 1 : {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
26194 1 : {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
26195 1 : {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
26196 1 : {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
26197 1 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
26198 1 : {&__pyx_n_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 1},
26199 1 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
26200 1 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
26201 1 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
26202 1 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
26203 1 : {&__pyx_n_s_aindex, __pyx_k_aindex, sizeof(__pyx_k_aindex), 0, 0, 1, 1},
26204 1 : {&__pyx_n_s_aindex_ptr, __pyx_k_aindex_ptr, sizeof(__pyx_k_aindex_ptr), 0, 0, 1, 1},
26205 1 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26206 1 : {&__pyx_n_u_allowed_simplex_cost_scale_facto, __pyx_k_allowed_simplex_cost_scale_facto, sizeof(__pyx_k_allowed_simplex_cost_scale_facto), 0, 1, 0, 1},
26207 1 : {&__pyx_n_u_allowed_simplex_matrix_scale_fac, __pyx_k_allowed_simplex_matrix_scale_fac, sizeof(__pyx_k_allowed_simplex_matrix_scale_fac), 0, 1, 0, 1},
26208 1 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
26209 1 : {&__pyx_kp_u_are_allowed_Using_default, __pyx_k_are_allowed_Using_default, sizeof(__pyx_k_are_allowed_Using_default), 0, 1, 0, 0},
26210 1 : {&__pyx_n_s_astart, __pyx_k_astart, sizeof(__pyx_k_astart), 0, 0, 1, 1},
26211 1 : {&__pyx_n_s_astart_ptr, __pyx_k_astart_ptr, sizeof(__pyx_k_astart_ptr), 0, 0, 1, 1},
26212 1 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
26213 1 : {&__pyx_n_s_avalue, __pyx_k_avalue, sizeof(__pyx_k_avalue), 0, 0, 1, 1},
26214 1 : {&__pyx_n_s_avalue_ptr, __pyx_k_avalue_ptr, sizeof(__pyx_k_avalue_ptr), 0, 0, 1, 1},
26215 1 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26216 1 : {&__pyx_n_s_basis, __pyx_k_basis, sizeof(__pyx_k_basis), 0, 0, 1, 1},
26217 1 : {&__pyx_kp_u_but_only_True_or_False_is_allow, __pyx_k_but_only_True_or_False_is_allow, sizeof(__pyx_k_but_only_True_or_False_is_allow), 0, 1, 0, 0},
26218 1 : {&__pyx_kp_u_but_only_values_in, __pyx_k_but_only_values_in, sizeof(__pyx_k_but_only_values_in), 0, 1, 0, 0},
26219 1 : {&__pyx_kp_u_but_only_values_in_s_are_allowed, __pyx_k_but_only_values_in_s_are_allowed, sizeof(__pyx_k_but_only_values_in_s_are_allowed), 0, 1, 0, 0},
26220 1 : {&__pyx_kp_u_but_this_is_an_invalid_value_s, __pyx_k_but_this_is_an_invalid_value_s, sizeof(__pyx_k_but_this_is_an_invalid_value_s), 0, 1, 0, 0},
26221 1 : {&__pyx_kp_u_but_this_is_not_a_valid_value_S, __pyx_k_but_this_is_not_a_valid_value_S, sizeof(__pyx_k_but_this_is_not_a_valid_value_S), 0, 1, 0, 0},
26222 1 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26223 1 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26224 1 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26225 1 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
26226 1 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26227 1 : {&__pyx_n_s_colcost_ptr, __pyx_k_colcost_ptr, sizeof(__pyx_k_colcost_ptr), 0, 0, 1, 1},
26228 1 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
26229 1 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
26230 1 : {&__pyx_n_s_collower_ptr, __pyx_k_collower_ptr, sizeof(__pyx_k_collower_ptr), 0, 0, 1, 1},
26231 1 : {&__pyx_n_s_colupper_ptr, __pyx_k_colupper_ptr, sizeof(__pyx_k_colupper_ptr), 0, 0, 1, 1},
26232 1 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26233 1 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26234 1 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
26235 1 : {&__pyx_n_u_crossover_nit, __pyx_k_crossover_nit, sizeof(__pyx_k_crossover_nit), 0, 1, 0, 1},
26236 1 : {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
26237 1 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26238 1 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
26239 1 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26240 1 : {&__pyx_n_u_dual_feasibility_tolerance, __pyx_k_dual_feasibility_tolerance, sizeof(__pyx_k_dual_feasibility_tolerance), 0, 1, 0, 1},
26241 1 : {&__pyx_n_u_dual_objective_value_upper_bound, __pyx_k_dual_objective_value_upper_bound, sizeof(__pyx_k_dual_objective_value_upper_bound), 0, 1, 0, 1},
26242 1 : {&__pyx_n_u_dual_simplex_cleanup_strategy, __pyx_k_dual_simplex_cleanup_strategy, sizeof(__pyx_k_dual_simplex_cleanup_strategy), 0, 1, 0, 1},
26243 1 : {&__pyx_n_u_dual_simplex_cost_perturbation_m, __pyx_k_dual_simplex_cost_perturbation_m, sizeof(__pyx_k_dual_simplex_cost_perturbation_m), 0, 1, 0, 1},
26244 1 : {&__pyx_n_u_dual_steepest_edge_weight_log_er, __pyx_k_dual_steepest_edge_weight_log_er, sizeof(__pyx_k_dual_steepest_edge_weight_log_er), 0, 1, 0, 1},
26245 1 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
26246 1 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26247 1 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26248 1 : {&__pyx_n_s_err_model_status, __pyx_k_err_model_status, sizeof(__pyx_k_err_model_status), 0, 0, 1, 1},
26249 1 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26250 1 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26251 1 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26252 1 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26253 1 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26254 1 : {&__pyx_n_u_fun, __pyx_k_fun, sizeof(__pyx_k_fun), 0, 1, 0, 1},
26255 1 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
26256 1 : {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
26257 1 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26258 1 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
26259 1 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
26260 1 : {&__pyx_n_s_highs, __pyx_k_highs, sizeof(__pyx_k_highs), 0, 0, 1, 1},
26261 1 : {&__pyx_n_u_highs_debug_level, __pyx_k_highs_debug_level, sizeof(__pyx_k_highs_debug_level), 0, 1, 0, 1},
26262 1 : {&__pyx_n_s_highs_wrapper, __pyx_k_highs_wrapper, sizeof(__pyx_k_highs_wrapper), 0, 0, 1, 1},
26263 1 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
26264 1 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26265 1 : {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1},
26266 1 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26267 1 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
26268 1 : {&__pyx_n_u_infinite_bound, __pyx_k_infinite_bound, sizeof(__pyx_k_infinite_bound), 0, 1, 0, 1},
26269 1 : {&__pyx_n_u_infinite_cost, __pyx_k_infinite_cost, sizeof(__pyx_k_infinite_cost), 0, 1, 0, 1},
26270 1 : {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
26271 1 : {&__pyx_n_s_init_status, __pyx_k_init_status, sizeof(__pyx_k_init_status), 0, 0, 1, 1},
26272 1 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
26273 1 : {&__pyx_n_s_integrality, __pyx_k_integrality, sizeof(__pyx_k_integrality), 0, 0, 1, 1},
26274 1 : {&__pyx_n_s_integrality_ptr, __pyx_k_integrality_ptr, sizeof(__pyx_k_integrality_ptr), 0, 0, 1, 1},
26275 1 : {&__pyx_n_u_ipm_iteration_limit, __pyx_k_ipm_iteration_limit, sizeof(__pyx_k_ipm_iteration_limit), 0, 1, 0, 1},
26276 1 : {&__pyx_n_u_ipm_nit, __pyx_k_ipm_nit, sizeof(__pyx_k_ipm_nit), 0, 1, 0, 1},
26277 1 : {&__pyx_n_u_ipm_optimality_tolerance, __pyx_k_ipm_optimality_tolerance, sizeof(__pyx_k_ipm_optimality_tolerance), 0, 1, 0, 1},
26278 1 : {&__pyx_kp_u_is, __pyx_k_is, sizeof(__pyx_k_is), 0, 1, 0, 0},
26279 1 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
26280 1 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
26281 1 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26282 1 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26283 1 : {&__pyx_n_u_keep_n_rows, __pyx_k_keep_n_rows, sizeof(__pyx_k_keep_n_rows), 0, 1, 0, 1},
26284 1 : {&__pyx_n_u_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 1, 0, 1},
26285 1 : {&__pyx_n_u_large_matrix_value, __pyx_k_large_matrix_value, sizeof(__pyx_k_large_matrix_value), 0, 1, 0, 1},
26286 1 : {&__pyx_n_s_lb, __pyx_k_lb, sizeof(__pyx_k_lb), 0, 0, 1, 1},
26287 1 : {&__pyx_n_u_less_infeasible_DSE_check, __pyx_k_less_infeasible_DSE_check, sizeof(__pyx_k_less_infeasible_DSE_check), 0, 1, 0, 1},
26288 1 : {&__pyx_n_u_less_infeasible_DSE_choose_row, __pyx_k_less_infeasible_DSE_choose_row, sizeof(__pyx_k_less_infeasible_DSE_choose_row), 0, 1, 0, 1},
26289 1 : {&__pyx_n_s_lhs, __pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 0, 1, 1},
26290 1 : {&__pyx_n_u_log_to_console, __pyx_k_log_to_console, sizeof(__pyx_k_log_to_console), 0, 1, 0, 1},
26291 1 : {&__pyx_n_s_lp, __pyx_k_lp, sizeof(__pyx_k_lp), 0, 0, 1, 1},
26292 1 : {&__pyx_n_s_lpFailCondition, __pyx_k_lpFailCondition, sizeof(__pyx_k_lpFailCondition), 0, 0, 1, 1},
26293 1 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26294 1 : {&__pyx_n_s_marg_bnds, __pyx_k_marg_bnds, sizeof(__pyx_k_marg_bnds), 0, 0, 1, 1},
26295 1 : {&__pyx_n_u_marg_bnds, __pyx_k_marg_bnds, sizeof(__pyx_k_marg_bnds), 0, 1, 0, 1},
26296 1 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26297 1 : {&__pyx_n_u_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 1, 0, 1},
26298 1 : {&__pyx_n_s_mipFailCondition, __pyx_k_mipFailCondition, sizeof(__pyx_k_mipFailCondition), 0, 0, 1, 1},
26299 1 : {&__pyx_n_u_mip_dual_bound, __pyx_k_mip_dual_bound, sizeof(__pyx_k_mip_dual_bound), 0, 1, 0, 1},
26300 1 : {&__pyx_n_u_mip_gap, __pyx_k_mip_gap, sizeof(__pyx_k_mip_gap), 0, 1, 0, 1},
26301 1 : {&__pyx_n_u_mip_max_nodes, __pyx_k_mip_max_nodes, sizeof(__pyx_k_mip_max_nodes), 0, 1, 0, 1},
26302 1 : {&__pyx_n_u_mip_node_count, __pyx_k_mip_node_count, sizeof(__pyx_k_mip_node_count), 0, 1, 0, 1},
26303 1 : {&__pyx_n_u_mip_rel_gap, __pyx_k_mip_rel_gap, sizeof(__pyx_k_mip_rel_gap), 0, 1, 0, 1},
26304 1 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26305 1 : {&__pyx_n_s_model_status, __pyx_k_model_status, sizeof(__pyx_k_model_status), 0, 0, 1, 1},
26306 1 : {&__pyx_kp_u_model_status_is, __pyx_k_model_status_is, sizeof(__pyx_k_model_status_is), 0, 1, 0, 0},
26307 1 : {&__pyx_n_u_mps_parser_type_free, __pyx_k_mps_parser_type_free, sizeof(__pyx_k_mps_parser_type_free), 0, 1, 0, 1},
26308 1 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26309 1 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26310 1 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26311 1 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26312 1 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26313 1 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
26314 1 : {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1},
26315 1 : {&__pyx_n_s_numcol, __pyx_k_numcol, sizeof(__pyx_k_numcol), 0, 0, 1, 1},
26316 1 : {&__pyx_n_s_numintegrality, __pyx_k_numintegrality, sizeof(__pyx_k_numintegrality), 0, 0, 1, 1},
26317 1 : {&__pyx_n_s_numnz, __pyx_k_numnz, sizeof(__pyx_k_numnz), 0, 0, 1, 1},
26318 1 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26319 1 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
26320 1 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
26321 1 : {&__pyx_n_s_numrow, __pyx_k_numrow, sizeof(__pyx_k_numrow), 0, 0, 1, 1},
26322 1 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26323 1 : {&__pyx_n_b_off, __pyx_k_off, sizeof(__pyx_k_off), 0, 0, 0, 1},
26324 1 : {&__pyx_n_b_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 0, 1},
26325 1 : {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
26326 1 : {&__pyx_n_u_output_flag, __pyx_k_output_flag, sizeof(__pyx_k_output_flag), 0, 1, 0, 1},
26327 1 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26328 1 : {&__pyx_n_u_parallel, __pyx_k_parallel, sizeof(__pyx_k_parallel), 0, 1, 0, 1},
26329 1 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26330 1 : {&__pyx_n_u_presolve, __pyx_k_presolve, sizeof(__pyx_k_presolve), 0, 1, 0, 1},
26331 1 : {&__pyx_n_u_primal_feasibility_tolerance, __pyx_k_primal_feasibility_tolerance, sizeof(__pyx_k_primal_feasibility_tolerance), 0, 1, 0, 1},
26332 1 : {&__pyx_kp_u_primal_status_is, __pyx_k_primal_status_is, sizeof(__pyx_k_primal_status_is), 0, 1, 0, 0},
26333 1 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26334 1 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26335 1 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26336 1 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26337 1 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26338 1 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26339 1 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26340 1 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26341 1 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26342 1 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26343 1 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26344 1 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
26345 1 : {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
26346 1 : {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1},
26347 1 : {&__pyx_n_s_rowlower_ptr, __pyx_k_rowlower_ptr, sizeof(__pyx_k_rowlower_ptr), 0, 0, 1, 1},
26348 1 : {&__pyx_n_s_rowupper_ptr, __pyx_k_rowupper_ptr, sizeof(__pyx_k_rowupper_ptr), 0, 0, 1, 1},
26349 1 : {&__pyx_n_u_run_as_hsol, __pyx_k_run_as_hsol, sizeof(__pyx_k_run_as_hsol), 0, 1, 0, 1},
26350 1 : {&__pyx_n_u_run_crossover, __pyx_k_run_crossover, sizeof(__pyx_k_run_crossover), 0, 1, 0, 1},
26351 1 : {&__pyx_n_s_run_status, __pyx_k_run_status, sizeof(__pyx_k_run_status), 0, 0, 1, 1},
26352 1 : {&__pyx_n_s_scipy_optimize, __pyx_k_scipy_optimize, sizeof(__pyx_k_scipy_optimize), 0, 0, 1, 1},
26353 1 : {&__pyx_n_s_scipy_optimize__highs_cython_src, __pyx_k_scipy_optimize__highs_cython_src, sizeof(__pyx_k_scipy_optimize__highs_cython_src), 0, 0, 1, 1},
26354 1 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26355 1 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26356 1 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26357 1 : {&__pyx_n_u_simplex_crash_strategy, __pyx_k_simplex_crash_strategy, sizeof(__pyx_k_simplex_crash_strategy), 0, 1, 0, 1},
26358 1 : {&__pyx_n_u_simplex_dual_edge_weight_strateg, __pyx_k_simplex_dual_edge_weight_strateg, sizeof(__pyx_k_simplex_dual_edge_weight_strateg), 0, 1, 0, 1},
26359 1 : {&__pyx_n_u_simplex_dualise_strategy, __pyx_k_simplex_dualise_strategy, sizeof(__pyx_k_simplex_dualise_strategy), 0, 1, 0, 1},
26360 1 : {&__pyx_n_u_simplex_initial_condition_check, __pyx_k_simplex_initial_condition_check, sizeof(__pyx_k_simplex_initial_condition_check), 0, 1, 0, 1},
26361 1 : {&__pyx_n_u_simplex_initial_condition_tolera, __pyx_k_simplex_initial_condition_tolera, sizeof(__pyx_k_simplex_initial_condition_tolera), 0, 1, 0, 1},
26362 1 : {&__pyx_n_u_simplex_iteration_limit, __pyx_k_simplex_iteration_limit, sizeof(__pyx_k_simplex_iteration_limit), 0, 1, 0, 1},
26363 1 : {&__pyx_n_u_simplex_nit, __pyx_k_simplex_nit, sizeof(__pyx_k_simplex_nit), 0, 1, 0, 1},
26364 1 : {&__pyx_n_u_simplex_permute_strategy, __pyx_k_simplex_permute_strategy, sizeof(__pyx_k_simplex_permute_strategy), 0, 1, 0, 1},
26365 1 : {&__pyx_n_u_simplex_price_strategy, __pyx_k_simplex_price_strategy, sizeof(__pyx_k_simplex_price_strategy), 0, 1, 0, 1},
26366 1 : {&__pyx_n_u_simplex_primal_edge_weight_strat, __pyx_k_simplex_primal_edge_weight_strat, sizeof(__pyx_k_simplex_primal_edge_weight_strat), 0, 1, 0, 1},
26367 1 : {&__pyx_n_u_simplex_scale_strategy, __pyx_k_simplex_scale_strategy, sizeof(__pyx_k_simplex_scale_strategy), 0, 1, 0, 1},
26368 1 : {&__pyx_n_u_simplex_strategy, __pyx_k_simplex_strategy, sizeof(__pyx_k_simplex_strategy), 0, 1, 0, 1},
26369 1 : {&__pyx_n_u_simplex_update_limit, __pyx_k_simplex_update_limit, sizeof(__pyx_k_simplex_update_limit), 0, 1, 0, 1},
26370 1 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26371 1 : {&__pyx_n_u_slack, __pyx_k_slack, sizeof(__pyx_k_slack), 0, 1, 0, 1},
26372 1 : {&__pyx_n_u_small_matrix_value, __pyx_k_small_matrix_value, sizeof(__pyx_k_small_matrix_value), 0, 1, 0, 1},
26373 1 : {&__pyx_n_s_solution, __pyx_k_solution, sizeof(__pyx_k_solution), 0, 0, 1, 1},
26374 1 : {&__pyx_n_u_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 1, 0, 1},
26375 1 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
26376 1 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26377 1 : {&__pyx_n_u_start_crossover_tolerance, __pyx_k_start_crossover_tolerance, sizeof(__pyx_k_start_crossover_tolerance), 0, 1, 0, 1},
26378 1 : {&__pyx_n_u_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 1, 0, 1},
26379 1 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26380 1 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26381 1 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26382 1 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26383 1 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26384 1 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26385 1 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
26386 1 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
26387 1 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
26388 1 : {&__pyx_n_u_threads, __pyx_k_threads, sizeof(__pyx_k_threads), 0, 1, 0, 1},
26389 1 : {&__pyx_n_u_time_limit, __pyx_k_time_limit, sizeof(__pyx_k_time_limit), 0, 1, 0, 1},
26390 1 : {&__pyx_n_s_ub, __pyx_k_ub, sizeof(__pyx_k_ub), 0, 0, 1, 1},
26391 1 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26392 1 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26393 1 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26394 1 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
26395 1 : {&__pyx_n_u_use_original_HFactor_logic, __pyx_k_use_original_HFactor_logic, sizeof(__pyx_k_use_original_HFactor_logic), 0, 1, 0, 1},
26396 1 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
26397 1 : {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
26398 1 : {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
26399 1 : {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
26400 1 : {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
26401 : {0, 0, 0, 0, 0, 0, 0}
26402 1 : };
26403 1 : return __Pyx_InitStrings(__pyx_string_tab);
26404 : }
26405 : /* #### Code section: cached_builtins ### */
26406 1 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
26407 1 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 85, __pyx_L1_error)
26408 1 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
26409 1 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 141, __pyx_L1_error)
26410 1 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 156, __pyx_L1_error)
26411 1 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
26412 1 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
26413 1 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
26414 1 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
26415 1 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
26416 1 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
26417 1 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
26418 : return 0;
26419 : __pyx_L1_error:;
26420 : return -1;
26421 : }
26422 : /* #### Code section: cached_constants ### */
26423 :
26424 1 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
26425 : __Pyx_RefNannyDeclarations
26426 1 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
26427 :
26428 : /* "View.MemoryView":582
26429 : * def suboffsets(self):
26430 : * if self.view.suboffsets == NULL:
26431 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
26432 : *
26433 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26434 : */
26435 1 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
26436 1 : __Pyx_GOTREF(__pyx_tuple__4);
26437 1 : __Pyx_INCREF(__pyx_int_neg_1);
26438 1 : __Pyx_GIVEREF(__pyx_int_neg_1);
26439 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
26440 1 : __Pyx_GIVEREF(__pyx_tuple__4);
26441 :
26442 : /* "View.MemoryView":679
26443 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
26444 : *
26445 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
26446 : * have_slices = False
26447 : * seen_ellipsis = False
26448 : */
26449 1 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
26450 1 : __Pyx_GOTREF(__pyx_slice__5);
26451 1 : __Pyx_GIVEREF(__pyx_slice__5);
26452 :
26453 : /* "(tree fragment)":4
26454 : * cdef object __pyx_PickleError
26455 : * cdef object __pyx_result
26456 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
26457 : * from pickle import PickleError as __pyx_PickleError
26458 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
26459 : */
26460 1 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
26461 1 : __Pyx_GOTREF(__pyx_tuple__8);
26462 1 : __Pyx_GIVEREF(__pyx_tuple__8);
26463 :
26464 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
26465 : * __pyx_import_array()
26466 : * except Exception:
26467 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
26468 : *
26469 : * cdef inline int import_umath() except -1:
26470 : */
26471 1 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
26472 1 : __Pyx_GOTREF(__pyx_tuple__9);
26473 1 : __Pyx_GIVEREF(__pyx_tuple__9);
26474 :
26475 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
26476 : * _import_umath()
26477 : * except Exception:
26478 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
26479 : *
26480 : * cdef inline int import_ufunc() except -1:
26481 : */
26482 1 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
26483 1 : __Pyx_GOTREF(__pyx_tuple__10);
26484 1 : __Pyx_GIVEREF(__pyx_tuple__10);
26485 :
26486 : /* "View.MemoryView":100
26487 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
26488 : * try:
26489 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
26490 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
26491 : * else:
26492 : */
26493 1 : __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 100, __pyx_L1_error)
26494 1 : __Pyx_GOTREF(__pyx_tuple__15);
26495 1 : __Pyx_GIVEREF(__pyx_tuple__15);
26496 1 : __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 100, __pyx_L1_error)
26497 1 : __Pyx_GOTREF(__pyx_tuple__16);
26498 1 : __Pyx_GIVEREF(__pyx_tuple__16);
26499 :
26500 : /* "View.MemoryView":101
26501 : * try:
26502 : * if __import__("sys").version_info >= (3, 3):
26503 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
26504 : * else:
26505 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
26506 : */
26507 1 : __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 101, __pyx_L1_error)
26508 1 : __Pyx_GOTREF(__pyx_tuple__17);
26509 1 : __Pyx_GIVEREF(__pyx_tuple__17);
26510 :
26511 : /* "View.MemoryView":103
26512 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
26513 : * else:
26514 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
26515 : * except:
26516 : *
26517 : */
26518 1 : __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 103, __pyx_L1_error)
26519 1 : __Pyx_GOTREF(__pyx_tuple__18);
26520 1 : __Pyx_GIVEREF(__pyx_tuple__18);
26521 :
26522 : /* "View.MemoryView":309
26523 : * return self.name
26524 : *
26525 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
26526 : * cdef strided = Enum("<strided and direct>") # default
26527 : * cdef indirect = Enum("<strided and indirect>")
26528 : */
26529 1 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 309, __pyx_L1_error)
26530 1 : __Pyx_GOTREF(__pyx_tuple__19);
26531 1 : __Pyx_GIVEREF(__pyx_tuple__19);
26532 :
26533 : /* "View.MemoryView":310
26534 : *
26535 : * cdef generic = Enum("<strided and direct or indirect>")
26536 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
26537 : * cdef indirect = Enum("<strided and indirect>")
26538 : *
26539 : */
26540 1 : __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 310, __pyx_L1_error)
26541 1 : __Pyx_GOTREF(__pyx_tuple__20);
26542 1 : __Pyx_GIVEREF(__pyx_tuple__20);
26543 :
26544 : /* "View.MemoryView":311
26545 : * cdef generic = Enum("<strided and direct or indirect>")
26546 : * cdef strided = Enum("<strided and direct>") # default
26547 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
26548 : *
26549 : *
26550 : */
26551 1 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 311, __pyx_L1_error)
26552 1 : __Pyx_GOTREF(__pyx_tuple__21);
26553 1 : __Pyx_GIVEREF(__pyx_tuple__21);
26554 :
26555 : /* "View.MemoryView":314
26556 : *
26557 : *
26558 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
26559 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
26560 : *
26561 : */
26562 1 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 314, __pyx_L1_error)
26563 1 : __Pyx_GOTREF(__pyx_tuple__22);
26564 1 : __Pyx_GIVEREF(__pyx_tuple__22);
26565 :
26566 : /* "View.MemoryView":315
26567 : *
26568 : * cdef contiguous = Enum("<contiguous and direct>")
26569 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
26570 : *
26571 : *
26572 : */
26573 1 : __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 315, __pyx_L1_error)
26574 1 : __Pyx_GOTREF(__pyx_tuple__23);
26575 1 : __Pyx_GIVEREF(__pyx_tuple__23);
26576 :
26577 : /* "(tree fragment)":1
26578 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
26579 : * cdef object __pyx_PickleError
26580 : * cdef object __pyx_result
26581 : */
26582 1 : __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 1, __pyx_L1_error)
26583 1 : __Pyx_GOTREF(__pyx_tuple__24);
26584 1 : __Pyx_GIVEREF(__pyx_tuple__24);
26585 1 : __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 1, __pyx_L1_error)
26586 :
26587 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":238
26588 : *
26589 : *
26590 : * def _highs_wrapper( # <<<<<<<<<<<<<<
26591 : * double[::1] c,
26592 : * int[::1] astart,
26593 : */
26594 1 : __pyx_tuple__26 = PyTuple_Pack(40, __pyx_n_s_c, __pyx_n_s_astart, __pyx_n_s_aindex, __pyx_n_s_avalue, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_lb, __pyx_n_s_ub, __pyx_n_s_integrality, __pyx_n_s_options, __pyx_n_s_numcol, __pyx_n_s_numrow, __pyx_n_s_numnz, __pyx_n_s_numintegrality, __pyx_n_s_lp, __pyx_n_s_integrality_ptr, __pyx_n_s_colcost_ptr, __pyx_n_s_collower_ptr, __pyx_n_s_colupper_ptr, __pyx_n_s_rowlower_ptr, __pyx_n_s_rowupper_ptr, __pyx_n_s_astart_ptr, __pyx_n_s_aindex_ptr, __pyx_n_s_avalue_ptr, __pyx_n_s_highs, __pyx_n_s_err_model_status, __pyx_n_s_init_status, __pyx_n_s_run_status, __pyx_n_s_model_status, __pyx_n_s_info, __pyx_n_s_solution, __pyx_n_s_basis, __pyx_n_s_marg_bnds, __pyx_n_s_mipFailCondition, __pyx_n_s_lpFailCondition, __pyx_n_s_ii, __pyx_n_s_res, __pyx_n_s_ii, __pyx_n_s_ii, __pyx_n_s_ii); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 238, __pyx_L1_error)
26595 1 : __Pyx_GOTREF(__pyx_tuple__26);
26596 1 : __Pyx_GIVEREF(__pyx_tuple__26);
26597 1 : __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 40, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_highs_wrapper, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 238, __pyx_L1_error)
26598 : __Pyx_RefNannyFinishContext();
26599 : return 0;
26600 : __pyx_L1_error:;
26601 : __Pyx_RefNannyFinishContext();
26602 : return -1;
26603 : }
26604 : /* #### Code section: init_constants ### */
26605 :
26606 1 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
26607 1 : __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
26608 1 : __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
26609 1 : __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
26610 1 : __pyx_umethod_PyDict_Type_update.method_name = &__pyx_n_s_update;
26611 1 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
26612 1 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
26613 1 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26614 1 : __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
26615 1 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
26616 1 : __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
26617 1 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
26618 1 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
26619 1 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
26620 1 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26621 : return 0;
26622 : __pyx_L1_error:;
26623 : return -1;
26624 : }
26625 : /* #### Code section: init_globals ### */
26626 :
26627 1 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
26628 : /* AssertionsEnabled.init */
26629 1 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
26630 :
26631 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
26632 :
26633 : return 0;
26634 0 : __pyx_L1_error:;
26635 0 : return -1;
26636 : }
26637 : /* #### Code section: init_module ### */
26638 :
26639 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
26640 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
26641 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
26642 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
26643 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
26644 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
26645 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
26646 :
26647 1 : static int __Pyx_modinit_global_init_code(void) {
26648 : __Pyx_RefNannyDeclarations
26649 1 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
26650 : /*--- Global init code ---*/
26651 1 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
26652 1 : generic = Py_None; Py_INCREF(Py_None);
26653 1 : strided = Py_None; Py_INCREF(Py_None);
26654 1 : indirect = Py_None; Py_INCREF(Py_None);
26655 1 : contiguous = Py_None; Py_INCREF(Py_None);
26656 1 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
26657 1 : __Pyx_RefNannyFinishContext();
26658 1 : return 0;
26659 : }
26660 :
26661 : static int __Pyx_modinit_variable_export_code(void) {
26662 : __Pyx_RefNannyDeclarations
26663 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
26664 : /*--- Variable export code ---*/
26665 : __Pyx_RefNannyFinishContext();
26666 : return 0;
26667 : }
26668 :
26669 : static int __Pyx_modinit_function_export_code(void) {
26670 : __Pyx_RefNannyDeclarations
26671 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
26672 : /*--- Function export code ---*/
26673 : __Pyx_RefNannyFinishContext();
26674 : return 0;
26675 : }
26676 :
26677 1 : static int __Pyx_modinit_type_init_code(void) {
26678 : __Pyx_RefNannyDeclarations
26679 1 : PyObject *__pyx_t_1 = NULL;
26680 1 : int __pyx_lineno = 0;
26681 1 : const char *__pyx_filename = NULL;
26682 1 : int __pyx_clineno = 0;
26683 1 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
26684 : /*--- Type init code ---*/
26685 1 : __pyx_vtabptr_array = &__pyx_vtable_array;
26686 1 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
26687 : #if CYTHON_USE_TYPE_SPECS
26688 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
26689 : #if !CYTHON_COMPILING_IN_LIMITED_API
26690 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
26691 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26692 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
26693 : }
26694 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26695 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26696 : #elif defined(_MSC_VER)
26697 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26698 : #else
26699 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26700 : #endif
26701 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26702 : #else
26703 1 : __pyx_array_type = &__pyx_type___pyx_array;
26704 : #endif
26705 : #if !CYTHON_COMPILING_IN_LIMITED_API
26706 : #endif
26707 : #if !CYTHON_USE_TYPE_SPECS
26708 1 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26709 : #endif
26710 : #if PY_MAJOR_VERSION < 3
26711 : __pyx_array_type->tp_print = 0;
26712 : #endif
26713 1 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26714 : #if !CYTHON_COMPILING_IN_LIMITED_API
26715 1 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26716 : #endif
26717 : #if !CYTHON_COMPILING_IN_LIMITED_API
26718 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26719 : #endif
26720 : #if CYTHON_USE_TYPE_SPECS
26721 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
26722 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26723 : #else
26724 1 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
26725 : #endif
26726 : #if !CYTHON_COMPILING_IN_LIMITED_API
26727 : #endif
26728 : #if !CYTHON_USE_TYPE_SPECS
26729 1 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26730 : #endif
26731 : #if PY_MAJOR_VERSION < 3
26732 : __pyx_MemviewEnum_type->tp_print = 0;
26733 : #endif
26734 : #if !CYTHON_COMPILING_IN_LIMITED_API
26735 1 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
26736 1 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26737 : }
26738 : #endif
26739 : #if !CYTHON_COMPILING_IN_LIMITED_API
26740 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26741 : #endif
26742 1 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
26743 1 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
26744 1 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
26745 1 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
26746 1 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
26747 1 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
26748 1 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
26749 1 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
26750 1 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
26751 : #if CYTHON_USE_TYPE_SPECS
26752 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
26753 : #if !CYTHON_COMPILING_IN_LIMITED_API
26754 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
26755 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26756 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
26757 : }
26758 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26759 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26760 : #elif defined(_MSC_VER)
26761 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26762 : #else
26763 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26764 : #endif
26765 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26766 : #else
26767 1 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
26768 : #endif
26769 : #if !CYTHON_COMPILING_IN_LIMITED_API
26770 : #endif
26771 : #if !CYTHON_USE_TYPE_SPECS
26772 1 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26773 : #endif
26774 : #if PY_MAJOR_VERSION < 3
26775 : __pyx_memoryview_type->tp_print = 0;
26776 : #endif
26777 : #if !CYTHON_COMPILING_IN_LIMITED_API
26778 1 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
26779 1 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26780 : }
26781 : #endif
26782 1 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26783 : #if !CYTHON_COMPILING_IN_LIMITED_API
26784 1 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26785 : #endif
26786 : #if !CYTHON_COMPILING_IN_LIMITED_API
26787 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
26788 : #endif
26789 1 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
26790 1 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
26791 1 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
26792 1 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
26793 1 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
26794 : #if CYTHON_USE_TYPE_SPECS
26795 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
26796 : __Pyx_GOTREF(__pyx_t_1);
26797 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
26798 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
26799 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
26800 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26801 : #else
26802 1 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
26803 : #endif
26804 : #if !CYTHON_COMPILING_IN_LIMITED_API
26805 1 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
26806 : #endif
26807 : #if !CYTHON_USE_TYPE_SPECS
26808 1 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26809 : #endif
26810 : #if PY_MAJOR_VERSION < 3
26811 : __pyx_memoryviewslice_type->tp_print = 0;
26812 : #endif
26813 : #if !CYTHON_COMPILING_IN_LIMITED_API
26814 1 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
26815 1 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26816 : }
26817 : #endif
26818 1 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26819 : #if !CYTHON_COMPILING_IN_LIMITED_API
26820 1 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26821 : #endif
26822 : #if !CYTHON_COMPILING_IN_LIMITED_API
26823 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
26824 : #endif
26825 : __Pyx_RefNannyFinishContext();
26826 : return 0;
26827 0 : __pyx_L1_error:;
26828 0 : __Pyx_XDECREF(__pyx_t_1);
26829 0 : __Pyx_RefNannyFinishContext();
26830 0 : return -1;
26831 : }
26832 :
26833 1 : static int __Pyx_modinit_type_import_code(void) {
26834 : __Pyx_RefNannyDeclarations
26835 1 : PyObject *__pyx_t_1 = NULL;
26836 1 : int __pyx_lineno = 0;
26837 1 : const char *__pyx_filename = NULL;
26838 1 : int __pyx_clineno = 0;
26839 1 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
26840 : /*--- Type import code ---*/
26841 1 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
26842 1 : __Pyx_GOTREF(__pyx_t_1);
26843 1 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
26844 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26845 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
26846 : #elif CYTHON_COMPILING_IN_LIMITED_API
26847 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
26848 : #else
26849 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
26850 : #endif
26851 1 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
26852 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26853 1 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
26854 1 : __Pyx_GOTREF(__pyx_t_1);
26855 1 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
26856 1 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
26857 1 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
26858 1 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
26859 1 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
26860 1 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
26861 1 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
26862 1 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
26863 1 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
26864 1 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
26865 1 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
26866 1 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
26867 1 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
26868 1 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
26869 1 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
26870 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26871 : __Pyx_RefNannyFinishContext();
26872 : return 0;
26873 0 : __pyx_L1_error:;
26874 0 : __Pyx_XDECREF(__pyx_t_1);
26875 0 : __Pyx_RefNannyFinishContext();
26876 0 : return -1;
26877 : }
26878 :
26879 : static int __Pyx_modinit_variable_import_code(void) {
26880 : __Pyx_RefNannyDeclarations
26881 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
26882 : /*--- Variable import code ---*/
26883 : __Pyx_RefNannyFinishContext();
26884 : return 0;
26885 : }
26886 :
26887 : static int __Pyx_modinit_function_import_code(void) {
26888 : __Pyx_RefNannyDeclarations
26889 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
26890 : /*--- Function import code ---*/
26891 : __Pyx_RefNannyFinishContext();
26892 : return 0;
26893 : }
26894 :
26895 :
26896 : #if PY_MAJOR_VERSION >= 3
26897 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26898 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26899 : static int __pyx_pymod_exec__highs_wrapper(PyObject* module); /*proto*/
26900 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26901 : {Py_mod_create, (void*)__pyx_pymod_create},
26902 : {Py_mod_exec, (void*)__pyx_pymod_exec__highs_wrapper},
26903 : {0, NULL}
26904 : };
26905 : #endif
26906 :
26907 : #ifdef __cplusplus
26908 : namespace {
26909 : struct PyModuleDef __pyx_moduledef =
26910 : #else
26911 : static struct PyModuleDef __pyx_moduledef =
26912 : #endif
26913 : {
26914 : PyModuleDef_HEAD_INIT,
26915 : "_highs_wrapper",
26916 : 0, /* m_doc */
26917 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26918 : 0, /* m_size */
26919 : #elif CYTHON_USE_MODULE_STATE
26920 : sizeof(__pyx_mstate), /* m_size */
26921 : #else
26922 : -1, /* m_size */
26923 : #endif
26924 : __pyx_methods /* m_methods */,
26925 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26926 : __pyx_moduledef_slots, /* m_slots */
26927 : #else
26928 : NULL, /* m_reload */
26929 : #endif
26930 : #if CYTHON_USE_MODULE_STATE
26931 : __pyx_m_traverse, /* m_traverse */
26932 : __pyx_m_clear, /* m_clear */
26933 : NULL /* m_free */
26934 : #else
26935 : NULL, /* m_traverse */
26936 : NULL, /* m_clear */
26937 : NULL /* m_free */
26938 : #endif
26939 : };
26940 : #ifdef __cplusplus
26941 : } /* anonymous namespace */
26942 : #endif
26943 : #endif
26944 :
26945 : #ifndef CYTHON_NO_PYINIT_EXPORT
26946 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
26947 : #elif PY_MAJOR_VERSION < 3
26948 : #ifdef __cplusplus
26949 : #define __Pyx_PyMODINIT_FUNC extern "C" void
26950 : #else
26951 : #define __Pyx_PyMODINIT_FUNC void
26952 : #endif
26953 : #else
26954 : #ifdef __cplusplus
26955 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
26956 : #else
26957 : #define __Pyx_PyMODINIT_FUNC PyObject *
26958 : #endif
26959 : #endif
26960 :
26961 :
26962 : #if PY_MAJOR_VERSION < 3
26963 : __Pyx_PyMODINIT_FUNC init_highs_wrapper(void) CYTHON_SMALL_CODE; /*proto*/
26964 : __Pyx_PyMODINIT_FUNC init_highs_wrapper(void)
26965 : #else
26966 : __Pyx_PyMODINIT_FUNC PyInit__highs_wrapper(void) CYTHON_SMALL_CODE; /*proto*/
26967 1 : __Pyx_PyMODINIT_FUNC PyInit__highs_wrapper(void)
26968 : #if CYTHON_PEP489_MULTI_PHASE_INIT
26969 : {
26970 1 : return PyModuleDef_Init(&__pyx_moduledef);
26971 : }
26972 1 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
26973 : #if PY_VERSION_HEX >= 0x030700A1
26974 1 : static PY_INT64_T main_interpreter_id = -1;
26975 1 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
26976 1 : if (main_interpreter_id == -1) {
26977 1 : main_interpreter_id = current_id;
26978 2 : return (unlikely(current_id == -1)) ? -1 : 0;
26979 0 : } else if (unlikely(main_interpreter_id != current_id))
26980 : #else
26981 : static PyInterpreterState *main_interpreter = NULL;
26982 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
26983 : if (!main_interpreter) {
26984 : main_interpreter = current_interpreter;
26985 : } else if (unlikely(main_interpreter != current_interpreter))
26986 : #endif
26987 : {
26988 0 : PyErr_SetString(
26989 : PyExc_ImportError,
26990 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
26991 0 : return -1;
26992 : }
26993 : return 0;
26994 : }
26995 : #if CYTHON_COMPILING_IN_LIMITED_API
26996 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
26997 : #else
26998 4 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
26999 : #endif
27000 : {
27001 4 : PyObject *value = PyObject_GetAttrString(spec, from_name);
27002 4 : int result = 0;
27003 4 : if (likely(value)) {
27004 4 : if (allow_none || value != Py_None) {
27005 : #if CYTHON_COMPILING_IN_LIMITED_API
27006 : result = PyModule_AddObject(module, to_name, value);
27007 : #else
27008 3 : result = PyDict_SetItemString(moddict, to_name, value);
27009 : #endif
27010 : }
27011 4 : Py_DECREF(value);
27012 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27013 0 : PyErr_Clear();
27014 : } else {
27015 : result = -1;
27016 : }
27017 4 : return result;
27018 : }
27019 1 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
27020 1 : PyObject *module = NULL, *moddict, *modname;
27021 1 : CYTHON_UNUSED_VAR(def);
27022 1 : if (__Pyx_check_single_interpreter())
27023 : return NULL;
27024 1 : if (__pyx_m)
27025 0 : return __Pyx_NewRef(__pyx_m);
27026 1 : modname = PyObject_GetAttrString(spec, "name");
27027 1 : if (unlikely(!modname)) goto bad;
27028 1 : module = PyModule_NewObject(modname);
27029 1 : Py_DECREF(modname);
27030 1 : if (unlikely(!module)) goto bad;
27031 : #if CYTHON_COMPILING_IN_LIMITED_API
27032 : moddict = module;
27033 : #else
27034 1 : moddict = PyModule_GetDict(module);
27035 1 : if (unlikely(!moddict)) goto bad;
27036 : #endif
27037 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27038 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27039 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27040 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27041 : return module;
27042 0 : bad:
27043 0 : Py_XDECREF(module);
27044 0 : return NULL;
27045 : }
27046 :
27047 :
27048 1 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__highs_wrapper(PyObject *__pyx_pyinit_module)
27049 : #endif
27050 : #endif
27051 : {
27052 1 : int stringtab_initialized = 0;
27053 : #if CYTHON_USE_MODULE_STATE
27054 : int pystate_addmodule_run = 0;
27055 : #endif
27056 1 : PyObject *__pyx_t_1 = NULL;
27057 1 : PyObject *__pyx_t_2 = NULL;
27058 1 : PyObject *__pyx_t_3 = NULL;
27059 1 : PyObject *__pyx_t_4 = NULL;
27060 1 : PyObject *__pyx_t_5 = NULL;
27061 1 : int __pyx_t_6;
27062 1 : PyObject *__pyx_t_7 = NULL;
27063 1 : static PyThread_type_lock __pyx_t_8[8];
27064 1 : int __pyx_t_9;
27065 1 : std::vector<OptionRecord *> ::iterator __pyx_t_10;
27066 1 : OptionRecord *__pyx_t_11;
27067 1 : int __pyx_lineno = 0;
27068 1 : const char *__pyx_filename = NULL;
27069 1 : int __pyx_clineno = 0;
27070 : __Pyx_RefNannyDeclarations
27071 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27072 1 : if (__pyx_m) {
27073 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
27074 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_highs_wrapper' has already been imported. Re-initialisation is not supported.");
27075 0 : return -1;
27076 : }
27077 : #elif PY_MAJOR_VERSION >= 3
27078 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27079 : #endif
27080 : /*--- Module creation code ---*/
27081 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27082 1 : __pyx_m = __pyx_pyinit_module;
27083 1 : Py_INCREF(__pyx_m);
27084 : #else
27085 : #if PY_MAJOR_VERSION < 3
27086 : __pyx_m = Py_InitModule4("_highs_wrapper", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27087 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27088 : #elif CYTHON_USE_MODULE_STATE
27089 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27090 : {
27091 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
27092 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_highs_wrapper" pseudovariable */
27093 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27094 : pystate_addmodule_run = 1;
27095 : }
27096 : #else
27097 : __pyx_m = PyModule_Create(&__pyx_moduledef);
27098 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27099 : #endif
27100 : #endif
27101 1 : CYTHON_UNUSED_VAR(__pyx_t_1);
27102 1 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27103 1 : Py_INCREF(__pyx_d);
27104 1 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27105 1 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27106 1 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27107 : #if CYTHON_REFNANNY
27108 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27109 : if (!__Pyx_RefNanny) {
27110 : PyErr_Clear();
27111 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27112 : if (!__Pyx_RefNanny)
27113 : Py_FatalError("failed to import 'refnanny' module");
27114 : }
27115 : #endif
27116 1 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__highs_wrapper(void)", 0);
27117 1 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27118 : #ifdef __Pxy_PyFrame_Initialize_Offsets
27119 : __Pxy_PyFrame_Initialize_Offsets();
27120 : #endif
27121 1 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27122 1 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27123 1 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27124 : #ifdef __Pyx_CyFunction_USED
27125 1 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27126 : #endif
27127 : #ifdef __Pyx_FusedFunction_USED
27128 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27129 : #endif
27130 : #ifdef __Pyx_Coroutine_USED
27131 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27132 : #endif
27133 : #ifdef __Pyx_Generator_USED
27134 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27135 : #endif
27136 : #ifdef __Pyx_AsyncGen_USED
27137 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27138 : #endif
27139 : #ifdef __Pyx_StopAsyncIteration_USED
27140 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27141 : #endif
27142 : /*--- Library function declarations ---*/
27143 : /*--- Threads initialization code ---*/
27144 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27145 : PyEval_InitThreads();
27146 : #endif
27147 : /*--- Initialize various global constants etc. ---*/
27148 1 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27149 1 : stringtab_initialized = 1;
27150 1 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27151 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27152 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27153 : #endif
27154 1 : if (__pyx_module_is_main_scipy__optimize___highs__cython__src___highs_wrapper) {
27155 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27156 : }
27157 : #if PY_MAJOR_VERSION >= 3
27158 1 : {
27159 1 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27160 1 : if (!PyDict_GetItemString(modules, "scipy.optimize._highs.cython.src._highs_wrapper")) {
27161 1 : if (unlikely((PyDict_SetItemString(modules, "scipy.optimize._highs.cython.src._highs_wrapper", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27162 : }
27163 : }
27164 : #endif
27165 : /*--- Builtin init code ---*/
27166 1 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27167 : /*--- Constants init code ---*/
27168 1 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27169 : /*--- Global type/function init code ---*/
27170 1 : (void)__Pyx_modinit_global_init_code();
27171 1 : (void)__Pyx_modinit_variable_export_code();
27172 1 : (void)__Pyx_modinit_function_export_code();
27173 1 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27174 1 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27175 1 : (void)__Pyx_modinit_variable_import_code();
27176 1 : (void)__Pyx_modinit_function_import_code();
27177 : /*--- Execution code ---*/
27178 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27179 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27180 : #endif
27181 :
27182 : /* "View.MemoryView":99
27183 : *
27184 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27185 : * try: # <<<<<<<<<<<<<<
27186 : * if __import__("sys").version_info >= (3, 3):
27187 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27188 : */
27189 1 : {
27190 1 : __Pyx_PyThreadState_declare
27191 1 : __Pyx_PyThreadState_assign
27192 1 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27193 1 : __Pyx_XGOTREF(__pyx_t_1);
27194 1 : __Pyx_XGOTREF(__pyx_t_2);
27195 1 : __Pyx_XGOTREF(__pyx_t_3);
27196 1 : /*try:*/ {
27197 :
27198 : /* "View.MemoryView":100
27199 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27200 : * try:
27201 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27202 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27203 : * else:
27204 : */
27205 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27206 1 : __Pyx_GOTREF(__pyx_t_4);
27207 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
27208 1 : __Pyx_GOTREF(__pyx_t_5);
27209 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27210 1 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__16, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27211 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27212 1 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
27213 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27214 1 : if (__pyx_t_6) {
27215 :
27216 : /* "View.MemoryView":101
27217 : * try:
27218 : * if __import__("sys").version_info >= (3, 3):
27219 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27220 : * else:
27221 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27222 : */
27223 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27224 1 : __Pyx_GOTREF(__pyx_t_4);
27225 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
27226 1 : __Pyx_GOTREF(__pyx_t_5);
27227 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27228 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27229 1 : __Pyx_GOTREF(__pyx_t_4);
27230 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27231 1 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27232 1 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27233 1 : __Pyx_GIVEREF(__pyx_t_4);
27234 1 : __pyx_t_4 = 0;
27235 :
27236 : /* "View.MemoryView":100
27237 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27238 : * try:
27239 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27240 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27241 : * else:
27242 : */
27243 1 : goto __pyx_L8;
27244 : }
27245 :
27246 : /* "View.MemoryView":103
27247 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27248 : * else:
27249 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
27250 : * except:
27251 : *
27252 : */
27253 0 : /*else*/ {
27254 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
27255 0 : __Pyx_GOTREF(__pyx_t_4);
27256 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
27257 0 : __Pyx_GOTREF(__pyx_t_5);
27258 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27259 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27260 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
27261 0 : __Pyx_GIVEREF(__pyx_t_5);
27262 0 : __pyx_t_5 = 0;
27263 : }
27264 1 : __pyx_L8:;
27265 :
27266 : /* "View.MemoryView":99
27267 : *
27268 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27269 : * try: # <<<<<<<<<<<<<<
27270 : * if __import__("sys").version_info >= (3, 3):
27271 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27272 : */
27273 : }
27274 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27275 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27276 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27277 1 : goto __pyx_L7_try_end;
27278 0 : __pyx_L2_error:;
27279 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27280 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27281 :
27282 : /* "View.MemoryView":104
27283 : * else:
27284 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27285 : * except: # <<<<<<<<<<<<<<
27286 : *
27287 : * __pyx_collections_abc_Sequence = None
27288 : */
27289 0 : /*except:*/ {
27290 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
27291 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
27292 0 : __Pyx_XGOTREF(__pyx_t_5);
27293 0 : __Pyx_XGOTREF(__pyx_t_4);
27294 0 : __Pyx_XGOTREF(__pyx_t_7);
27295 :
27296 : /* "View.MemoryView":106
27297 : * except:
27298 : *
27299 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
27300 : *
27301 : *
27302 : */
27303 0 : __Pyx_INCREF(Py_None);
27304 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27305 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27306 0 : __Pyx_GIVEREF(Py_None);
27307 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27308 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27309 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27310 0 : goto __pyx_L3_exception_handled;
27311 : }
27312 :
27313 : /* "View.MemoryView":99
27314 : *
27315 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27316 : * try: # <<<<<<<<<<<<<<
27317 : * if __import__("sys").version_info >= (3, 3):
27318 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27319 : */
27320 0 : __pyx_L4_except_error:;
27321 0 : __Pyx_XGIVEREF(__pyx_t_1);
27322 0 : __Pyx_XGIVEREF(__pyx_t_2);
27323 0 : __Pyx_XGIVEREF(__pyx_t_3);
27324 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27325 0 : goto __pyx_L1_error;
27326 0 : __pyx_L3_exception_handled:;
27327 0 : __Pyx_XGIVEREF(__pyx_t_1);
27328 0 : __Pyx_XGIVEREF(__pyx_t_2);
27329 0 : __Pyx_XGIVEREF(__pyx_t_3);
27330 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27331 1 : __pyx_L7_try_end:;
27332 : }
27333 :
27334 : /* "View.MemoryView":241
27335 : *
27336 : *
27337 : * try: # <<<<<<<<<<<<<<
27338 : * count = __pyx_collections_abc_Sequence.count
27339 : * index = __pyx_collections_abc_Sequence.index
27340 : */
27341 1 : {
27342 1 : __Pyx_PyThreadState_declare
27343 1 : __Pyx_PyThreadState_assign
27344 1 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27345 1 : __Pyx_XGOTREF(__pyx_t_3);
27346 1 : __Pyx_XGOTREF(__pyx_t_2);
27347 1 : __Pyx_XGOTREF(__pyx_t_1);
27348 1 : /*try:*/ {
27349 :
27350 : /* "View.MemoryView":242
27351 : *
27352 : * try:
27353 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27354 : * index = __pyx_collections_abc_Sequence.index
27355 : * except:
27356 : */
27357 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
27358 1 : __Pyx_GOTREF(__pyx_t_7);
27359 1 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
27360 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27361 1 : PyType_Modified(__pyx_array_type);
27362 :
27363 : /* "View.MemoryView":243
27364 : * try:
27365 : * count = __pyx_collections_abc_Sequence.count
27366 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27367 : * except:
27368 : * pass
27369 : */
27370 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
27371 1 : __Pyx_GOTREF(__pyx_t_7);
27372 1 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
27373 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27374 1 : PyType_Modified(__pyx_array_type);
27375 :
27376 : /* "View.MemoryView":241
27377 : *
27378 : *
27379 : * try: # <<<<<<<<<<<<<<
27380 : * count = __pyx_collections_abc_Sequence.count
27381 : * index = __pyx_collections_abc_Sequence.index
27382 : */
27383 : }
27384 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27385 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27386 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27387 1 : goto __pyx_L16_try_end;
27388 0 : __pyx_L11_error:;
27389 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27390 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27391 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27392 :
27393 : /* "View.MemoryView":244
27394 : * count = __pyx_collections_abc_Sequence.count
27395 : * index = __pyx_collections_abc_Sequence.index
27396 : * except: # <<<<<<<<<<<<<<
27397 : * pass
27398 : *
27399 : */
27400 0 : /*except:*/ {
27401 0 : __Pyx_ErrRestore(0,0,0);
27402 0 : goto __pyx_L12_exception_handled;
27403 : }
27404 0 : __pyx_L12_exception_handled:;
27405 0 : __Pyx_XGIVEREF(__pyx_t_3);
27406 0 : __Pyx_XGIVEREF(__pyx_t_2);
27407 0 : __Pyx_XGIVEREF(__pyx_t_1);
27408 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27409 1 : __pyx_L16_try_end:;
27410 : }
27411 :
27412 : /* "View.MemoryView":309
27413 : * return self.name
27414 : *
27415 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27416 : * cdef strided = Enum("<strided and direct>") # default
27417 : * cdef indirect = Enum("<strided and indirect>")
27418 : */
27419 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
27420 1 : __Pyx_GOTREF(__pyx_t_7);
27421 1 : __Pyx_XGOTREF(generic);
27422 1 : __Pyx_DECREF_SET(generic, __pyx_t_7);
27423 1 : __Pyx_GIVEREF(__pyx_t_7);
27424 1 : __pyx_t_7 = 0;
27425 :
27426 : /* "View.MemoryView":310
27427 : *
27428 : * cdef generic = Enum("<strided and direct or indirect>")
27429 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27430 : * cdef indirect = Enum("<strided and indirect>")
27431 : *
27432 : */
27433 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
27434 1 : __Pyx_GOTREF(__pyx_t_7);
27435 1 : __Pyx_XGOTREF(strided);
27436 1 : __Pyx_DECREF_SET(strided, __pyx_t_7);
27437 1 : __Pyx_GIVEREF(__pyx_t_7);
27438 1 : __pyx_t_7 = 0;
27439 :
27440 : /* "View.MemoryView":311
27441 : * cdef generic = Enum("<strided and direct or indirect>")
27442 : * cdef strided = Enum("<strided and direct>") # default
27443 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27444 : *
27445 : *
27446 : */
27447 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
27448 1 : __Pyx_GOTREF(__pyx_t_7);
27449 1 : __Pyx_XGOTREF(indirect);
27450 1 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
27451 1 : __Pyx_GIVEREF(__pyx_t_7);
27452 1 : __pyx_t_7 = 0;
27453 :
27454 : /* "View.MemoryView":314
27455 : *
27456 : *
27457 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27458 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27459 : *
27460 : */
27461 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
27462 1 : __Pyx_GOTREF(__pyx_t_7);
27463 1 : __Pyx_XGOTREF(contiguous);
27464 1 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
27465 1 : __Pyx_GIVEREF(__pyx_t_7);
27466 1 : __pyx_t_7 = 0;
27467 :
27468 : /* "View.MemoryView":315
27469 : *
27470 : * cdef contiguous = Enum("<contiguous and direct>")
27471 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27472 : *
27473 : *
27474 : */
27475 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
27476 1 : __Pyx_GOTREF(__pyx_t_7);
27477 1 : __Pyx_XGOTREF(indirect_contiguous);
27478 1 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
27479 1 : __Pyx_GIVEREF(__pyx_t_7);
27480 1 : __pyx_t_7 = 0;
27481 :
27482 : /* "View.MemoryView":323
27483 : *
27484 : *
27485 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27486 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
27487 : * PyThread_allocate_lock(),
27488 : */
27489 1 : __pyx_memoryview_thread_locks_used = 0;
27490 :
27491 : /* "View.MemoryView":324
27492 : *
27493 : * cdef int __pyx_memoryview_thread_locks_used = 0
27494 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27495 : * PyThread_allocate_lock(),
27496 : * PyThread_allocate_lock(),
27497 : */
27498 1 : __pyx_t_8[0] = PyThread_allocate_lock();
27499 1 : __pyx_t_8[1] = PyThread_allocate_lock();
27500 1 : __pyx_t_8[2] = PyThread_allocate_lock();
27501 1 : __pyx_t_8[3] = PyThread_allocate_lock();
27502 1 : __pyx_t_8[4] = PyThread_allocate_lock();
27503 1 : __pyx_t_8[5] = PyThread_allocate_lock();
27504 1 : __pyx_t_8[6] = PyThread_allocate_lock();
27505 1 : __pyx_t_8[7] = PyThread_allocate_lock();
27506 1 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27507 :
27508 : /* "View.MemoryView":982
27509 : *
27510 : *
27511 : * try: # <<<<<<<<<<<<<<
27512 : * count = __pyx_collections_abc_Sequence.count
27513 : * index = __pyx_collections_abc_Sequence.index
27514 : */
27515 1 : {
27516 1 : __Pyx_PyThreadState_declare
27517 1 : __Pyx_PyThreadState_assign
27518 1 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27519 1 : __Pyx_XGOTREF(__pyx_t_1);
27520 1 : __Pyx_XGOTREF(__pyx_t_2);
27521 1 : __Pyx_XGOTREF(__pyx_t_3);
27522 1 : /*try:*/ {
27523 :
27524 : /* "View.MemoryView":983
27525 : *
27526 : * try:
27527 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27528 : * index = __pyx_collections_abc_Sequence.index
27529 : * except:
27530 : */
27531 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
27532 1 : __Pyx_GOTREF(__pyx_t_7);
27533 1 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
27534 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27535 1 : PyType_Modified(__pyx_memoryviewslice_type);
27536 :
27537 : /* "View.MemoryView":984
27538 : * try:
27539 : * count = __pyx_collections_abc_Sequence.count
27540 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27541 : * except:
27542 : * pass
27543 : */
27544 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
27545 1 : __Pyx_GOTREF(__pyx_t_7);
27546 1 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
27547 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27548 1 : PyType_Modified(__pyx_memoryviewslice_type);
27549 :
27550 : /* "View.MemoryView":982
27551 : *
27552 : *
27553 : * try: # <<<<<<<<<<<<<<
27554 : * count = __pyx_collections_abc_Sequence.count
27555 : * index = __pyx_collections_abc_Sequence.index
27556 : */
27557 : }
27558 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27559 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27560 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27561 1 : goto __pyx_L22_try_end;
27562 0 : __pyx_L17_error:;
27563 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27564 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27565 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27566 :
27567 : /* "View.MemoryView":985
27568 : * count = __pyx_collections_abc_Sequence.count
27569 : * index = __pyx_collections_abc_Sequence.index
27570 : * except: # <<<<<<<<<<<<<<
27571 : * pass
27572 : *
27573 : */
27574 0 : /*except:*/ {
27575 0 : __Pyx_ErrRestore(0,0,0);
27576 0 : goto __pyx_L18_exception_handled;
27577 : }
27578 0 : __pyx_L18_exception_handled:;
27579 0 : __Pyx_XGIVEREF(__pyx_t_1);
27580 0 : __Pyx_XGIVEREF(__pyx_t_2);
27581 0 : __Pyx_XGIVEREF(__pyx_t_3);
27582 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27583 1 : __pyx_L22_try_end:;
27584 : }
27585 :
27586 : /* "View.MemoryView":988
27587 : * pass
27588 : *
27589 : * try: # <<<<<<<<<<<<<<
27590 : * if __pyx_collections_abc_Sequence:
27591 : *
27592 : */
27593 1 : {
27594 1 : __Pyx_PyThreadState_declare
27595 1 : __Pyx_PyThreadState_assign
27596 1 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27597 1 : __Pyx_XGOTREF(__pyx_t_3);
27598 1 : __Pyx_XGOTREF(__pyx_t_2);
27599 1 : __Pyx_XGOTREF(__pyx_t_1);
27600 1 : /*try:*/ {
27601 :
27602 : /* "View.MemoryView":989
27603 : *
27604 : * try:
27605 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27606 : *
27607 : *
27608 : */
27609 1 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
27610 1 : if (__pyx_t_6) {
27611 :
27612 : /* "View.MemoryView":993
27613 : *
27614 : *
27615 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
27616 : * __pyx_collections_abc_Sequence.register(array)
27617 : * except:
27618 : */
27619 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
27620 1 : __Pyx_GOTREF(__pyx_t_7);
27621 1 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
27622 1 : __Pyx_GOTREF(__pyx_t_4);
27623 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27624 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27625 :
27626 : /* "View.MemoryView":994
27627 : *
27628 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27629 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
27630 : * except:
27631 : * pass # ignore failure, it's a minor issue
27632 : */
27633 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
27634 1 : __Pyx_GOTREF(__pyx_t_4);
27635 1 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
27636 1 : __Pyx_GOTREF(__pyx_t_7);
27637 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27638 2 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27639 :
27640 : /* "View.MemoryView":989
27641 : *
27642 : * try:
27643 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27644 : *
27645 : *
27646 : */
27647 : }
27648 :
27649 : /* "View.MemoryView":988
27650 : * pass
27651 : *
27652 : * try: # <<<<<<<<<<<<<<
27653 : * if __pyx_collections_abc_Sequence:
27654 : *
27655 : */
27656 : }
27657 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27658 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27659 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27660 1 : goto __pyx_L28_try_end;
27661 0 : __pyx_L23_error:;
27662 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27663 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27664 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27665 :
27666 : /* "View.MemoryView":995
27667 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27668 : * __pyx_collections_abc_Sequence.register(array)
27669 : * except: # <<<<<<<<<<<<<<
27670 : * pass # ignore failure, it's a minor issue
27671 : *
27672 : */
27673 0 : /*except:*/ {
27674 0 : __Pyx_ErrRestore(0,0,0);
27675 0 : goto __pyx_L24_exception_handled;
27676 : }
27677 0 : __pyx_L24_exception_handled:;
27678 0 : __Pyx_XGIVEREF(__pyx_t_3);
27679 0 : __Pyx_XGIVEREF(__pyx_t_2);
27680 0 : __Pyx_XGIVEREF(__pyx_t_1);
27681 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27682 1 : __pyx_L28_try_end:;
27683 : }
27684 :
27685 : /* "(tree fragment)":1
27686 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
27687 : * cdef object __pyx_PickleError
27688 : * cdef object __pyx_result
27689 : */
27690 1 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
27691 1 : __Pyx_GOTREF(__pyx_t_7);
27692 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27693 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27694 :
27695 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":3
27696 : * # cython: language_level=3
27697 : *
27698 : * import numpy as np # <<<<<<<<<<<<<<
27699 : * cimport numpy as np
27700 : * from scipy.optimize import OptimizeWarning
27701 : */
27702 1 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3, __pyx_L1_error)
27703 1 : __Pyx_GOTREF(__pyx_t_7);
27704 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
27705 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27706 :
27707 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":5
27708 : * import numpy as np
27709 : * cimport numpy as np
27710 : * from scipy.optimize import OptimizeWarning # <<<<<<<<<<<<<<
27711 : * from warnings import warn
27712 : * import numbers
27713 : */
27714 1 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27715 1 : __Pyx_GOTREF(__pyx_t_7);
27716 1 : __Pyx_INCREF(__pyx_n_s_OptimizeWarning);
27717 1 : __Pyx_GIVEREF(__pyx_n_s_OptimizeWarning);
27718 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_OptimizeWarning)) __PYX_ERR(0, 5, __pyx_L1_error);
27719 1 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_scipy_optimize, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
27720 1 : __Pyx_GOTREF(__pyx_t_4);
27721 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27722 1 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_OptimizeWarning); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27723 1 : __Pyx_GOTREF(__pyx_t_7);
27724 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_OptimizeWarning, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
27725 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27726 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27727 :
27728 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":6
27729 : * cimport numpy as np
27730 : * from scipy.optimize import OptimizeWarning
27731 : * from warnings import warn # <<<<<<<<<<<<<<
27732 : * import numbers
27733 : *
27734 : */
27735 1 : __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
27736 1 : __Pyx_GOTREF(__pyx_t_4);
27737 1 : __Pyx_INCREF(__pyx_n_s_warn);
27738 1 : __Pyx_GIVEREF(__pyx_n_s_warn);
27739 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_warn)) __PYX_ERR(0, 6, __pyx_L1_error);
27740 1 : __pyx_t_7 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6, __pyx_L1_error)
27741 1 : __Pyx_GOTREF(__pyx_t_7);
27742 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27743 1 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
27744 1 : __Pyx_GOTREF(__pyx_t_4);
27745 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_4) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
27746 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27747 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27748 :
27749 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":7
27750 : * from scipy.optimize import OptimizeWarning
27751 : * from warnings import warn
27752 : * import numbers # <<<<<<<<<<<<<<
27753 : *
27754 : * from libcpp.string cimport string
27755 : */
27756 1 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numbers, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7, __pyx_L1_error)
27757 1 : __Pyx_GOTREF(__pyx_t_7);
27758 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_7) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
27759 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27760 :
27761 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":59
27762 : * from .HighsModelUtils cimport utilBasisStatusToString
27763 : *
27764 : * np.import_array() # <<<<<<<<<<<<<<
27765 : *
27766 : * # options to reference for default values and bounds;
27767 : */
27768 1 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 59, __pyx_L1_error)
27769 :
27770 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":65
27771 : * cdef HighsOptions _ref_opts
27772 : * cdef cppmap[string, OptionRecord*] _ref_opt_lookup
27773 : * cdef OptionRecord * _r = NULL # <<<<<<<<<<<<<<
27774 : * for _r in _ref_opts.records:
27775 : * _ref_opt_lookup[_r.name] = _r
27776 : */
27777 1 : __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__r = NULL;
27778 :
27779 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":66
27780 : * cdef cppmap[string, OptionRecord*] _ref_opt_lookup
27781 : * cdef OptionRecord * _r = NULL
27782 : * for _r in _ref_opts.records: # <<<<<<<<<<<<<<
27783 : * _ref_opt_lookup[_r.name] = _r
27784 : *
27785 : */
27786 1 : __pyx_t_10 = __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__ref_opts.records.begin();
27787 187 : for (;;) {
27788 94 : if (!(__pyx_t_10 != __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__ref_opts.records.end())) break;
27789 93 : __pyx_t_11 = *__pyx_t_10;
27790 93 : ++__pyx_t_10;
27791 93 : __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__r = __pyx_t_11;
27792 :
27793 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":67
27794 : * cdef OptionRecord * _r = NULL
27795 : * for _r in _ref_opts.records:
27796 : * _ref_opt_lookup[_r.name] = _r # <<<<<<<<<<<<<<
27797 : *
27798 : *
27799 : */
27800 93 : (__pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__ref_opt_lookup[__pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__r->name]) = __pyx_v_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper__r;
27801 :
27802 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":66
27803 : * cdef cppmap[string, OptionRecord*] _ref_opt_lookup
27804 : * cdef OptionRecord * _r = NULL
27805 : * for _r in _ref_opts.records: # <<<<<<<<<<<<<<
27806 : * _ref_opt_lookup[_r.name] = _r
27807 : *
27808 : */
27809 : }
27810 :
27811 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":238
27812 : *
27813 : *
27814 : * def _highs_wrapper( # <<<<<<<<<<<<<<
27815 : * double[::1] c,
27816 : * int[::1] astart,
27817 : */
27818 1 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_8optimize_6_highs_6cython_3src_14_highs_wrapper_1_highs_wrapper, 0, __pyx_n_s_highs_wrapper, NULL, __pyx_n_s_scipy_optimize__highs_cython_src, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
27819 1 : __Pyx_GOTREF(__pyx_t_7);
27820 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_highs_wrapper, __pyx_t_7) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
27821 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27822 :
27823 : /* "scipy/optimize/_highs/cython/src/_highs_wrapper.pyx":1
27824 : * # cython: language_level=3 # <<<<<<<<<<<<<<
27825 : *
27826 : * import numpy as np
27827 : */
27828 1 : __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
27829 1 : __Pyx_GOTREF(__pyx_t_7);
27830 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27831 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27832 :
27833 : /*--- Wrapped vars code ---*/
27834 :
27835 1 : goto __pyx_L0;
27836 0 : __pyx_L1_error:;
27837 0 : __Pyx_XDECREF(__pyx_t_4);
27838 0 : __Pyx_XDECREF(__pyx_t_5);
27839 0 : __Pyx_XDECREF(__pyx_t_7);
27840 0 : if (__pyx_m) {
27841 0 : if (__pyx_d && stringtab_initialized) {
27842 0 : __Pyx_AddTraceback("init scipy.optimize._highs.cython.src._highs_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
27843 : }
27844 : #if !CYTHON_USE_MODULE_STATE
27845 0 : Py_CLEAR(__pyx_m);
27846 : #else
27847 : Py_DECREF(__pyx_m);
27848 : if (pystate_addmodule_run) {
27849 : PyObject *tp, *value, *tb;
27850 : PyErr_Fetch(&tp, &value, &tb);
27851 : PyState_RemoveModule(&__pyx_moduledef);
27852 : PyErr_Restore(tp, value, tb);
27853 : }
27854 : #endif
27855 0 : } else if (!PyErr_Occurred()) {
27856 0 : PyErr_SetString(PyExc_ImportError, "init scipy.optimize._highs.cython.src._highs_wrapper");
27857 : }
27858 0 : __pyx_L0:;
27859 1 : __Pyx_RefNannyFinishContext();
27860 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27861 1 : return (__pyx_m != NULL) ? 0 : -1;
27862 : #elif PY_MAJOR_VERSION >= 3
27863 : return __pyx_m;
27864 : #else
27865 : return;
27866 : #endif
27867 : }
27868 : /* #### Code section: cleanup_globals ### */
27869 : /* #### Code section: cleanup_module ### */
27870 : /* #### Code section: main_method ### */
27871 : /* #### Code section: utility_code_pragmas ### */
27872 : #ifdef _MSC_VER
27873 : #pragma warning( push )
27874 : /* Warning 4127: conditional expression is constant
27875 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
27876 : * compile-time, so this warning is not useful
27877 : */
27878 : #pragma warning( disable : 4127 )
27879 : #endif
27880 :
27881 :
27882 :
27883 : /* #### Code section: utility_code_def ### */
27884 :
27885 : /* --- Runtime support code --- */
27886 : /* Refnanny */
27887 : #if CYTHON_REFNANNY
27888 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
27889 : PyObject *m = NULL, *p = NULL;
27890 : void *r = NULL;
27891 : m = PyImport_ImportModule(modname);
27892 : if (!m) goto end;
27893 : p = PyObject_GetAttrString(m, "RefNannyAPI");
27894 : if (!p) goto end;
27895 : r = PyLong_AsVoidPtr(p);
27896 : end:
27897 : Py_XDECREF(p);
27898 : Py_XDECREF(m);
27899 : return (__Pyx_RefNannyAPIStruct *)r;
27900 : }
27901 : #endif
27902 :
27903 : /* PyErrExceptionMatches */
27904 : #if CYTHON_FAST_THREAD_STATE
27905 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27906 0 : Py_ssize_t i, n;
27907 0 : n = PyTuple_GET_SIZE(tuple);
27908 : #if PY_MAJOR_VERSION >= 3
27909 0 : for (i=0; i<n; i++) {
27910 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27911 : }
27912 : #endif
27913 0 : for (i=0; i<n; i++) {
27914 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
27915 : }
27916 : return 0;
27917 : }
27918 3 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
27919 3 : int result;
27920 3 : PyObject *exc_type;
27921 : #if PY_VERSION_HEX >= 0x030C00A6
27922 3 : PyObject *current_exception = tstate->current_exception;
27923 3 : if (unlikely(!current_exception)) return 0;
27924 3 : exc_type = (PyObject*) Py_TYPE(current_exception);
27925 3 : if (exc_type == err) return 1;
27926 : #else
27927 : exc_type = tstate->curexc_type;
27928 : if (exc_type == err) return 1;
27929 : if (unlikely(!exc_type)) return 0;
27930 : #endif
27931 : #if CYTHON_AVOID_BORROWED_REFS
27932 : Py_INCREF(exc_type);
27933 : #endif
27934 0 : if (unlikely(PyTuple_Check(err))) {
27935 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
27936 : } else {
27937 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
27938 : }
27939 : #if CYTHON_AVOID_BORROWED_REFS
27940 : Py_DECREF(exc_type);
27941 : #endif
27942 : return result;
27943 : }
27944 : #endif
27945 :
27946 : /* PyErrFetchRestore */
27947 : #if CYTHON_FAST_THREAD_STATE
27948 3 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27949 : #if PY_VERSION_HEX >= 0x030C00A6
27950 3 : PyObject *tmp_value;
27951 3 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
27952 3 : if (value) {
27953 : #if CYTHON_COMPILING_IN_CPYTHON
27954 0 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
27955 : #endif
27956 0 : PyException_SetTraceback(value, tb);
27957 : }
27958 3 : tmp_value = tstate->current_exception;
27959 3 : tstate->current_exception = value;
27960 3 : Py_XDECREF(tmp_value);
27961 3 : Py_XDECREF(type);
27962 3 : Py_XDECREF(tb);
27963 : #else
27964 : PyObject *tmp_type, *tmp_value, *tmp_tb;
27965 : tmp_type = tstate->curexc_type;
27966 : tmp_value = tstate->curexc_value;
27967 : tmp_tb = tstate->curexc_traceback;
27968 : tstate->curexc_type = type;
27969 : tstate->curexc_value = value;
27970 : tstate->curexc_traceback = tb;
27971 : Py_XDECREF(tmp_type);
27972 : Py_XDECREF(tmp_value);
27973 : Py_XDECREF(tmp_tb);
27974 : #endif
27975 3 : }
27976 0 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27977 : #if PY_VERSION_HEX >= 0x030C00A6
27978 0 : PyObject* exc_value;
27979 0 : exc_value = tstate->current_exception;
27980 0 : tstate->current_exception = 0;
27981 0 : *value = exc_value;
27982 0 : *type = NULL;
27983 0 : *tb = NULL;
27984 0 : if (exc_value) {
27985 0 : *type = (PyObject*) Py_TYPE(exc_value);
27986 0 : Py_INCREF(*type);
27987 : #if CYTHON_COMPILING_IN_CPYTHON
27988 0 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
27989 0 : Py_XINCREF(*tb);
27990 : #else
27991 : *tb = PyException_GetTraceback(exc_value);
27992 : #endif
27993 : }
27994 : #else
27995 : *type = tstate->curexc_type;
27996 : *value = tstate->curexc_value;
27997 : *tb = tstate->curexc_traceback;
27998 : tstate->curexc_type = 0;
27999 : tstate->curexc_value = 0;
28000 : tstate->curexc_traceback = 0;
28001 : #endif
28002 0 : }
28003 : #endif
28004 :
28005 : /* PyObjectGetAttrStr */
28006 : #if CYTHON_USE_TYPE_SLOTS
28007 19666 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28008 19666 : PyTypeObject* tp = Py_TYPE(obj);
28009 19666 : if (likely(tp->tp_getattro))
28010 19666 : return tp->tp_getattro(obj, attr_name);
28011 : #if PY_MAJOR_VERSION < 3
28012 : if (likely(tp->tp_getattr))
28013 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28014 : #endif
28015 0 : return PyObject_GetAttr(obj, attr_name);
28016 : }
28017 : #endif
28018 :
28019 : /* PyObjectGetAttrStrNoError */
28020 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
28021 3 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28022 3 : __Pyx_PyThreadState_declare
28023 3 : __Pyx_PyThreadState_assign
28024 3 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28025 3 : __Pyx_PyErr_Clear();
28026 3 : }
28027 : #endif
28028 29 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28029 29 : PyObject *result;
28030 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
28031 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
28032 : return result;
28033 : #else
28034 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28035 29 : PyTypeObject* tp = Py_TYPE(obj);
28036 29 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28037 4 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28038 : }
28039 : #endif
28040 25 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28041 25 : if (unlikely(!result)) {
28042 3 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28043 : }
28044 : return result;
28045 : #endif
28046 : }
28047 :
28048 : /* GetBuiltinName */
28049 11 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28050 11 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
28051 11 : if (unlikely(!result) && !PyErr_Occurred()) {
28052 0 : PyErr_Format(PyExc_NameError,
28053 : #if PY_MAJOR_VERSION >= 3
28054 : "name '%U' is not defined", name);
28055 : #else
28056 : "name '%.200s' is not defined", PyString_AS_STRING(name));
28057 : #endif
28058 : }
28059 11 : return result;
28060 : }
28061 :
28062 : /* TupleAndListFromArray */
28063 : #if CYTHON_COMPILING_IN_CPYTHON
28064 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28065 : PyObject *v;
28066 : Py_ssize_t i;
28067 : for (i = 0; i < length; i++) {
28068 : v = dest[i] = src[i];
28069 : Py_INCREF(v);
28070 : }
28071 : }
28072 : static CYTHON_INLINE PyObject *
28073 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
28074 : {
28075 : PyObject *res;
28076 : if (n <= 0) {
28077 : Py_INCREF(__pyx_empty_tuple);
28078 : return __pyx_empty_tuple;
28079 : }
28080 : res = PyTuple_New(n);
28081 : if (unlikely(res == NULL)) return NULL;
28082 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28083 : return res;
28084 : }
28085 : static CYTHON_INLINE PyObject *
28086 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
28087 : {
28088 : PyObject *res;
28089 : if (n <= 0) {
28090 : return PyList_New(0);
28091 : }
28092 : res = PyList_New(n);
28093 : if (unlikely(res == NULL)) return NULL;
28094 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
28095 : return res;
28096 : }
28097 : #endif
28098 :
28099 : /* BytesEquals */
28100 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
28101 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28102 : return PyObject_RichCompareBool(s1, s2, equals);
28103 : #else
28104 : if (s1 == s2) {
28105 : return (equals == Py_EQ);
28106 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28107 : const char *ps1, *ps2;
28108 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
28109 : if (length != PyBytes_GET_SIZE(s2))
28110 : return (equals == Py_NE);
28111 : ps1 = PyBytes_AS_STRING(s1);
28112 : ps2 = PyBytes_AS_STRING(s2);
28113 : if (ps1[0] != ps2[0]) {
28114 : return (equals == Py_NE);
28115 : } else if (length == 1) {
28116 : return (equals == Py_EQ);
28117 : } else {
28118 : int result;
28119 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
28120 : Py_hash_t hash1, hash2;
28121 : hash1 = ((PyBytesObject*)s1)->ob_shash;
28122 : hash2 = ((PyBytesObject*)s2)->ob_shash;
28123 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28124 : return (equals == Py_NE);
28125 : }
28126 : #endif
28127 : result = memcmp(ps1, ps2, (size_t)length);
28128 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28129 : }
28130 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28131 : return (equals == Py_NE);
28132 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28133 : return (equals == Py_NE);
28134 : } else {
28135 : int result;
28136 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28137 : if (!py_result)
28138 : return -1;
28139 : result = __Pyx_PyObject_IsTrue(py_result);
28140 : Py_DECREF(py_result);
28141 : return result;
28142 : }
28143 : #endif
28144 : }
28145 :
28146 : /* UnicodeEquals */
28147 2269 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
28148 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28149 : return PyObject_RichCompareBool(s1, s2, equals);
28150 : #else
28151 : #if PY_MAJOR_VERSION < 3
28152 : PyObject* owned_ref = NULL;
28153 : #endif
28154 2269 : int s1_is_unicode, s2_is_unicode;
28155 2269 : if (s1 == s2) {
28156 0 : goto return_eq;
28157 : }
28158 2269 : s1_is_unicode = PyUnicode_CheckExact(s1);
28159 2269 : s2_is_unicode = PyUnicode_CheckExact(s2);
28160 : #if PY_MAJOR_VERSION < 3
28161 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
28162 : owned_ref = PyUnicode_FromObject(s2);
28163 : if (unlikely(!owned_ref))
28164 : return -1;
28165 : s2 = owned_ref;
28166 : s2_is_unicode = 1;
28167 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
28168 : owned_ref = PyUnicode_FromObject(s1);
28169 : if (unlikely(!owned_ref))
28170 : return -1;
28171 : s1 = owned_ref;
28172 : s1_is_unicode = 1;
28173 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
28174 : return __Pyx_PyBytes_Equals(s1, s2, equals);
28175 : }
28176 : #endif
28177 2269 : if (s1_is_unicode & s2_is_unicode) {
28178 2269 : Py_ssize_t length;
28179 2269 : int kind;
28180 2269 : void *data1, *data2;
28181 2269 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
28182 : return -1;
28183 2269 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
28184 2269 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
28185 2269 : goto return_ne;
28186 : }
28187 : #if CYTHON_USE_UNICODE_INTERNALS
28188 0 : {
28189 0 : Py_hash_t hash1, hash2;
28190 : #if CYTHON_PEP393_ENABLED
28191 0 : hash1 = ((PyASCIIObject*)s1)->hash;
28192 0 : hash2 = ((PyASCIIObject*)s2)->hash;
28193 : #else
28194 : hash1 = ((PyUnicodeObject*)s1)->hash;
28195 : hash2 = ((PyUnicodeObject*)s2)->hash;
28196 : #endif
28197 0 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28198 0 : goto return_ne;
28199 : }
28200 : }
28201 : #endif
28202 0 : kind = __Pyx_PyUnicode_KIND(s1);
28203 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
28204 0 : goto return_ne;
28205 : }
28206 0 : data1 = __Pyx_PyUnicode_DATA(s1);
28207 0 : data2 = __Pyx_PyUnicode_DATA(s2);
28208 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
28209 0 : goto return_ne;
28210 0 : } else if (length == 1) {
28211 0 : goto return_eq;
28212 : } else {
28213 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
28214 : #if PY_MAJOR_VERSION < 3
28215 : Py_XDECREF(owned_ref);
28216 : #endif
28217 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28218 : }
28219 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
28220 0 : goto return_ne;
28221 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
28222 0 : goto return_ne;
28223 : } else {
28224 0 : int result;
28225 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28226 : #if PY_MAJOR_VERSION < 3
28227 : Py_XDECREF(owned_ref);
28228 : #endif
28229 0 : if (!py_result)
28230 : return -1;
28231 0 : result = __Pyx_PyObject_IsTrue(py_result);
28232 0 : Py_DECREF(py_result);
28233 0 : return result;
28234 : }
28235 0 : return_eq:
28236 : #if PY_MAJOR_VERSION < 3
28237 : Py_XDECREF(owned_ref);
28238 : #endif
28239 0 : return (equals == Py_EQ);
28240 2269 : return_ne:
28241 : #if PY_MAJOR_VERSION < 3
28242 : Py_XDECREF(owned_ref);
28243 : #endif
28244 2269 : return (equals == Py_NE);
28245 : #endif
28246 : }
28247 :
28248 : /* fastcall */
28249 : #if CYTHON_METH_FASTCALL
28250 0 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28251 : {
28252 0 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
28253 0 : for (i = 0; i < n; i++)
28254 : {
28255 0 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
28256 : }
28257 0 : for (i = 0; i < n; i++)
28258 : {
28259 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
28260 0 : if (unlikely(eq != 0)) {
28261 0 : if (unlikely(eq < 0)) return NULL;
28262 0 : return kwvalues[i];
28263 : }
28264 : }
28265 : return NULL;
28266 : }
28267 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
28268 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28269 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
28270 : PyObject *dict;
28271 : dict = PyDict_New();
28272 : if (unlikely(!dict))
28273 : return NULL;
28274 : for (i=0; i<nkwargs; i++) {
28275 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28276 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28277 : goto bad;
28278 : }
28279 : return dict;
28280 : bad:
28281 : Py_DECREF(dict);
28282 : return NULL;
28283 : }
28284 : #endif
28285 : #endif
28286 :
28287 : /* RaiseArgTupleInvalid */
28288 0 : static void __Pyx_RaiseArgtupleInvalid(
28289 : const char* func_name,
28290 : int exact,
28291 : Py_ssize_t num_min,
28292 : Py_ssize_t num_max,
28293 : Py_ssize_t num_found)
28294 : {
28295 0 : Py_ssize_t num_expected;
28296 0 : const char *more_or_less;
28297 0 : if (num_found < num_min) {
28298 : num_expected = num_min;
28299 : more_or_less = "at least";
28300 : } else {
28301 0 : num_expected = num_max;
28302 0 : more_or_less = "at most";
28303 : }
28304 0 : if (exact) {
28305 0 : more_or_less = "exactly";
28306 : }
28307 0 : PyErr_Format(PyExc_TypeError,
28308 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28309 : func_name, more_or_less, num_expected,
28310 : (num_expected == 1) ? "" : "s", num_found);
28311 0 : }
28312 :
28313 : /* RaiseDoubleKeywords */
28314 0 : static void __Pyx_RaiseDoubleKeywordsError(
28315 : const char* func_name,
28316 : PyObject* kw_name)
28317 : {
28318 0 : PyErr_Format(PyExc_TypeError,
28319 : #if PY_MAJOR_VERSION >= 3
28320 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28321 : #else
28322 : "%s() got multiple values for keyword argument '%s'", func_name,
28323 : PyString_AsString(kw_name));
28324 : #endif
28325 : }
28326 :
28327 : /* ParseKeywords */
28328 0 : static int __Pyx_ParseOptionalKeywords(
28329 : PyObject *kwds,
28330 : PyObject *const *kwvalues,
28331 : PyObject **argnames[],
28332 : PyObject *kwds2,
28333 : PyObject *values[],
28334 : Py_ssize_t num_pos_args,
28335 : const char* function_name)
28336 : {
28337 0 : PyObject *key = 0, *value = 0;
28338 0 : Py_ssize_t pos = 0;
28339 0 : PyObject*** name;
28340 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
28341 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
28342 0 : while (1) {
28343 0 : Py_XDECREF(key); key = NULL;
28344 0 : Py_XDECREF(value); value = NULL;
28345 0 : if (kwds_is_tuple) {
28346 0 : Py_ssize_t size;
28347 : #if CYTHON_ASSUME_SAFE_MACROS
28348 0 : size = PyTuple_GET_SIZE(kwds);
28349 : #else
28350 : size = PyTuple_Size(kwds);
28351 : if (size < 0) goto bad;
28352 : #endif
28353 0 : if (pos >= size) break;
28354 : #if CYTHON_AVOID_BORROWED_REFS
28355 : key = __Pyx_PySequence_ITEM(kwds, pos);
28356 : if (!key) goto bad;
28357 : #elif CYTHON_ASSUME_SAFE_MACROS
28358 0 : key = PyTuple_GET_ITEM(kwds, pos);
28359 : #else
28360 : key = PyTuple_GetItem(kwds, pos);
28361 : if (!key) goto bad;
28362 : #endif
28363 0 : value = kwvalues[pos];
28364 0 : pos++;
28365 : }
28366 : else
28367 : {
28368 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
28369 : #if CYTHON_AVOID_BORROWED_REFS
28370 : Py_INCREF(key);
28371 : #endif
28372 : }
28373 0 : name = first_kw_arg;
28374 0 : while (*name && (**name != key)) name++;
28375 0 : if (*name) {
28376 0 : values[name-argnames] = value;
28377 : #if CYTHON_AVOID_BORROWED_REFS
28378 : Py_INCREF(value);
28379 : Py_DECREF(key);
28380 : #endif
28381 0 : key = NULL;
28382 0 : value = NULL;
28383 0 : continue;
28384 : }
28385 : #if !CYTHON_AVOID_BORROWED_REFS
28386 0 : Py_INCREF(key);
28387 : #endif
28388 0 : Py_INCREF(value);
28389 0 : name = first_kw_arg;
28390 : #if PY_MAJOR_VERSION < 3
28391 : if (likely(PyString_Check(key))) {
28392 : while (*name) {
28393 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28394 : && _PyString_Eq(**name, key)) {
28395 : values[name-argnames] = value;
28396 : #if CYTHON_AVOID_BORROWED_REFS
28397 : value = NULL;
28398 : #endif
28399 : break;
28400 : }
28401 : name++;
28402 : }
28403 : if (*name) continue;
28404 : else {
28405 : PyObject*** argname = argnames;
28406 : while (argname != first_kw_arg) {
28407 : if ((**argname == key) || (
28408 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28409 : && _PyString_Eq(**argname, key))) {
28410 : goto arg_passed_twice;
28411 : }
28412 : argname++;
28413 : }
28414 : }
28415 : } else
28416 : #endif
28417 0 : if (likely(PyUnicode_Check(key))) {
28418 0 : while (*name) {
28419 0 : int cmp = (
28420 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28421 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28422 : #endif
28423 0 : PyUnicode_Compare(**name, key)
28424 0 : );
28425 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28426 0 : if (cmp == 0) {
28427 0 : values[name-argnames] = value;
28428 : #if CYTHON_AVOID_BORROWED_REFS
28429 : value = NULL;
28430 : #endif
28431 0 : break;
28432 : }
28433 0 : name++;
28434 : }
28435 0 : if (*name) continue;
28436 : else {
28437 : PyObject*** argname = argnames;
28438 0 : while (argname != first_kw_arg) {
28439 0 : int cmp = (**argname == key) ? 0 :
28440 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28441 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28442 : #endif
28443 0 : PyUnicode_Compare(**argname, key);
28444 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28445 0 : if (cmp == 0) goto arg_passed_twice;
28446 0 : argname++;
28447 : }
28448 : }
28449 : } else
28450 0 : goto invalid_keyword_type;
28451 0 : if (kwds2) {
28452 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28453 : } else {
28454 0 : goto invalid_keyword;
28455 : }
28456 : }
28457 0 : Py_XDECREF(key);
28458 0 : Py_XDECREF(value);
28459 : return 0;
28460 0 : arg_passed_twice:
28461 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
28462 0 : goto bad;
28463 0 : invalid_keyword_type:
28464 0 : PyErr_Format(PyExc_TypeError,
28465 : "%.200s() keywords must be strings", function_name);
28466 0 : goto bad;
28467 0 : invalid_keyword:
28468 : #if PY_MAJOR_VERSION < 3
28469 : PyErr_Format(PyExc_TypeError,
28470 : "%.200s() got an unexpected keyword argument '%.200s'",
28471 : function_name, PyString_AsString(key));
28472 : #else
28473 0 : PyErr_Format(PyExc_TypeError,
28474 : "%s() got an unexpected keyword argument '%U'",
28475 : function_name, key);
28476 : #endif
28477 0 : bad:
28478 0 : Py_XDECREF(key);
28479 0 : Py_XDECREF(value);
28480 : return -1;
28481 : }
28482 :
28483 : /* ArgTypeTest */
28484 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
28485 : {
28486 0 : __Pyx_TypeName type_name;
28487 0 : __Pyx_TypeName obj_type_name;
28488 0 : if (unlikely(!type)) {
28489 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
28490 0 : return 0;
28491 : }
28492 0 : else if (exact) {
28493 : #if PY_MAJOR_VERSION == 2
28494 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
28495 : #endif
28496 : }
28497 : else {
28498 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
28499 : }
28500 0 : type_name = __Pyx_PyType_GetName(type);
28501 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
28502 0 : PyErr_Format(PyExc_TypeError,
28503 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
28504 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
28505 0 : __Pyx_DECREF_TypeName(type_name);
28506 0 : __Pyx_DECREF_TypeName(obj_type_name);
28507 0 : return 0;
28508 : }
28509 :
28510 : /* RaiseException */
28511 : #if PY_MAJOR_VERSION < 3
28512 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28513 : __Pyx_PyThreadState_declare
28514 : CYTHON_UNUSED_VAR(cause);
28515 : Py_XINCREF(type);
28516 : if (!value || value == Py_None)
28517 : value = NULL;
28518 : else
28519 : Py_INCREF(value);
28520 : if (!tb || tb == Py_None)
28521 : tb = NULL;
28522 : else {
28523 : Py_INCREF(tb);
28524 : if (!PyTraceBack_Check(tb)) {
28525 : PyErr_SetString(PyExc_TypeError,
28526 : "raise: arg 3 must be a traceback or None");
28527 : goto raise_error;
28528 : }
28529 : }
28530 : if (PyType_Check(type)) {
28531 : #if CYTHON_COMPILING_IN_PYPY
28532 : if (!value) {
28533 : Py_INCREF(Py_None);
28534 : value = Py_None;
28535 : }
28536 : #endif
28537 : PyErr_NormalizeException(&type, &value, &tb);
28538 : } else {
28539 : if (value) {
28540 : PyErr_SetString(PyExc_TypeError,
28541 : "instance exception may not have a separate value");
28542 : goto raise_error;
28543 : }
28544 : value = type;
28545 : type = (PyObject*) Py_TYPE(type);
28546 : Py_INCREF(type);
28547 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28548 : PyErr_SetString(PyExc_TypeError,
28549 : "raise: exception class must be a subclass of BaseException");
28550 : goto raise_error;
28551 : }
28552 : }
28553 : __Pyx_PyThreadState_assign
28554 : __Pyx_ErrRestore(type, value, tb);
28555 : return;
28556 : raise_error:
28557 : Py_XDECREF(value);
28558 : Py_XDECREF(type);
28559 : Py_XDECREF(tb);
28560 : return;
28561 : }
28562 : #else
28563 0 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28564 0 : PyObject* owned_instance = NULL;
28565 0 : if (tb == Py_None) {
28566 : tb = 0;
28567 0 : } else if (tb && !PyTraceBack_Check(tb)) {
28568 0 : PyErr_SetString(PyExc_TypeError,
28569 : "raise: arg 3 must be a traceback or None");
28570 0 : goto bad;
28571 : }
28572 0 : if (value == Py_None)
28573 0 : value = 0;
28574 0 : if (PyExceptionInstance_Check(type)) {
28575 0 : if (value) {
28576 0 : PyErr_SetString(PyExc_TypeError,
28577 : "instance exception may not have a separate value");
28578 0 : goto bad;
28579 : }
28580 : value = type;
28581 : type = (PyObject*) Py_TYPE(value);
28582 0 : } else if (PyExceptionClass_Check(type)) {
28583 0 : PyObject *instance_class = NULL;
28584 0 : if (value && PyExceptionInstance_Check(value)) {
28585 0 : instance_class = (PyObject*) Py_TYPE(value);
28586 0 : if (instance_class != type) {
28587 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
28588 0 : if (!is_subclass) {
28589 : instance_class = NULL;
28590 0 : } else if (unlikely(is_subclass == -1)) {
28591 0 : goto bad;
28592 : } else {
28593 : type = instance_class;
28594 : }
28595 : }
28596 : }
28597 : if (!instance_class) {
28598 0 : PyObject *args;
28599 0 : if (!value)
28600 0 : args = PyTuple_New(0);
28601 0 : else if (PyTuple_Check(value)) {
28602 0 : Py_INCREF(value);
28603 0 : args = value;
28604 : } else
28605 0 : args = PyTuple_Pack(1, value);
28606 0 : if (!args)
28607 0 : goto bad;
28608 0 : owned_instance = PyObject_Call(type, args, NULL);
28609 0 : Py_DECREF(args);
28610 0 : if (!owned_instance)
28611 0 : goto bad;
28612 0 : value = owned_instance;
28613 0 : if (!PyExceptionInstance_Check(value)) {
28614 0 : PyErr_Format(PyExc_TypeError,
28615 : "calling %R should have returned an instance of "
28616 : "BaseException, not %R",
28617 : type, Py_TYPE(value));
28618 0 : goto bad;
28619 : }
28620 : }
28621 : } else {
28622 0 : PyErr_SetString(PyExc_TypeError,
28623 : "raise: exception class must be a subclass of BaseException");
28624 0 : goto bad;
28625 : }
28626 0 : if (cause) {
28627 0 : PyObject *fixed_cause;
28628 0 : if (cause == Py_None) {
28629 : fixed_cause = NULL;
28630 0 : } else if (PyExceptionClass_Check(cause)) {
28631 0 : fixed_cause = PyObject_CallObject(cause, NULL);
28632 0 : if (fixed_cause == NULL)
28633 0 : goto bad;
28634 0 : } else if (PyExceptionInstance_Check(cause)) {
28635 0 : fixed_cause = cause;
28636 0 : Py_INCREF(fixed_cause);
28637 : } else {
28638 0 : PyErr_SetString(PyExc_TypeError,
28639 : "exception causes must derive from "
28640 : "BaseException");
28641 0 : goto bad;
28642 : }
28643 0 : PyException_SetCause(value, fixed_cause);
28644 : }
28645 0 : PyErr_SetObject(type, value);
28646 0 : if (tb) {
28647 : #if PY_VERSION_HEX >= 0x030C00A6
28648 0 : PyException_SetTraceback(value, tb);
28649 : #elif CYTHON_FAST_THREAD_STATE
28650 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
28651 : PyObject* tmp_tb = tstate->curexc_traceback;
28652 : if (tb != tmp_tb) {
28653 : Py_INCREF(tb);
28654 : tstate->curexc_traceback = tb;
28655 : Py_XDECREF(tmp_tb);
28656 : }
28657 : #else
28658 : PyObject *tmp_type, *tmp_value, *tmp_tb;
28659 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28660 : Py_INCREF(tb);
28661 : PyErr_Restore(tmp_type, tmp_value, tb);
28662 : Py_XDECREF(tmp_tb);
28663 : #endif
28664 : }
28665 0 : bad:
28666 0 : Py_XDECREF(owned_instance);
28667 0 : return;
28668 : }
28669 : #endif
28670 :
28671 : /* PyFunctionFastCall */
28672 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
28673 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28674 : PyObject *globals) {
28675 : PyFrameObject *f;
28676 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
28677 : PyObject **fastlocals;
28678 : Py_ssize_t i;
28679 : PyObject *result;
28680 : assert(globals != NULL);
28681 : /* XXX Perhaps we should create a specialized
28682 : PyFrame_New() that doesn't take locals, but does
28683 : take builtins without sanity checking them.
28684 : */
28685 : assert(tstate != NULL);
28686 : f = PyFrame_New(tstate, co, globals, NULL);
28687 : if (f == NULL) {
28688 : return NULL;
28689 : }
28690 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
28691 : for (i = 0; i < na; i++) {
28692 : Py_INCREF(*args);
28693 : fastlocals[i] = *args++;
28694 : }
28695 : result = PyEval_EvalFrameEx(f,0);
28696 : ++tstate->recursion_depth;
28697 : Py_DECREF(f);
28698 : --tstate->recursion_depth;
28699 : return result;
28700 : }
28701 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
28702 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
28703 : PyObject *globals = PyFunction_GET_GLOBALS(func);
28704 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
28705 : PyObject *closure;
28706 : #if PY_MAJOR_VERSION >= 3
28707 : PyObject *kwdefs;
28708 : #endif
28709 : PyObject *kwtuple, **k;
28710 : PyObject **d;
28711 : Py_ssize_t nd;
28712 : Py_ssize_t nk;
28713 : PyObject *result;
28714 : assert(kwargs == NULL || PyDict_Check(kwargs));
28715 : nk = kwargs ? PyDict_Size(kwargs) : 0;
28716 : #if PY_MAJOR_VERSION < 3
28717 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
28718 : return NULL;
28719 : }
28720 : #else
28721 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
28722 : return NULL;
28723 : }
28724 : #endif
28725 : if (
28726 : #if PY_MAJOR_VERSION >= 3
28727 : co->co_kwonlyargcount == 0 &&
28728 : #endif
28729 : likely(kwargs == NULL || nk == 0) &&
28730 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
28731 : if (argdefs == NULL && co->co_argcount == nargs) {
28732 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
28733 : goto done;
28734 : }
28735 : else if (nargs == 0 && argdefs != NULL
28736 : && co->co_argcount == Py_SIZE(argdefs)) {
28737 : /* function called with no arguments, but all parameters have
28738 : a default value: use default values as arguments .*/
28739 : args = &PyTuple_GET_ITEM(argdefs, 0);
28740 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
28741 : goto done;
28742 : }
28743 : }
28744 : if (kwargs != NULL) {
28745 : Py_ssize_t pos, i;
28746 : kwtuple = PyTuple_New(2 * nk);
28747 : if (kwtuple == NULL) {
28748 : result = NULL;
28749 : goto done;
28750 : }
28751 : k = &PyTuple_GET_ITEM(kwtuple, 0);
28752 : pos = i = 0;
28753 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
28754 : Py_INCREF(k[i]);
28755 : Py_INCREF(k[i+1]);
28756 : i += 2;
28757 : }
28758 : nk = i / 2;
28759 : }
28760 : else {
28761 : kwtuple = NULL;
28762 : k = NULL;
28763 : }
28764 : closure = PyFunction_GET_CLOSURE(func);
28765 : #if PY_MAJOR_VERSION >= 3
28766 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
28767 : #endif
28768 : if (argdefs != NULL) {
28769 : d = &PyTuple_GET_ITEM(argdefs, 0);
28770 : nd = Py_SIZE(argdefs);
28771 : }
28772 : else {
28773 : d = NULL;
28774 : nd = 0;
28775 : }
28776 : #if PY_MAJOR_VERSION >= 3
28777 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
28778 : args, (int)nargs,
28779 : k, (int)nk,
28780 : d, (int)nd, kwdefs, closure);
28781 : #else
28782 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
28783 : args, (int)nargs,
28784 : k, (int)nk,
28785 : d, (int)nd, closure);
28786 : #endif
28787 : Py_XDECREF(kwtuple);
28788 : done:
28789 : Py_LeaveRecursiveCall();
28790 : return result;
28791 : }
28792 : #endif
28793 :
28794 : /* PyObjectCall */
28795 : #if CYTHON_COMPILING_IN_CPYTHON
28796 10013 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28797 10013 : PyObject *result;
28798 10013 : ternaryfunc call = Py_TYPE(func)->tp_call;
28799 10013 : if (unlikely(!call))
28800 0 : return PyObject_Call(func, arg, kw);
28801 : #if PY_MAJOR_VERSION < 3
28802 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28803 : return NULL;
28804 : #else
28805 10013 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28806 : return NULL;
28807 : #endif
28808 10013 : result = (*call)(func, arg, kw);
28809 10013 : Py_LeaveRecursiveCall();
28810 10013 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28811 0 : PyErr_SetString(
28812 : PyExc_SystemError,
28813 : "NULL result without error in PyObject_Call");
28814 : }
28815 : return result;
28816 : }
28817 : #endif
28818 :
28819 : /* PyObjectCallMethO */
28820 : #if CYTHON_COMPILING_IN_CPYTHON
28821 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28822 0 : PyObject *self, *result;
28823 0 : PyCFunction cfunc;
28824 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
28825 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
28826 : #if PY_MAJOR_VERSION < 3
28827 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28828 : return NULL;
28829 : #else
28830 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28831 : return NULL;
28832 : #endif
28833 0 : result = cfunc(self, arg);
28834 0 : Py_LeaveRecursiveCall();
28835 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28836 0 : PyErr_SetString(
28837 : PyExc_SystemError,
28838 : "NULL result without error in PyObject_Call");
28839 : }
28840 : return result;
28841 : }
28842 : #endif
28843 :
28844 : /* PyObjectFastCall */
28845 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
28846 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
28847 : PyObject *argstuple;
28848 : PyObject *result = 0;
28849 : size_t i;
28850 : argstuple = PyTuple_New((Py_ssize_t)nargs);
28851 : if (unlikely(!argstuple)) return NULL;
28852 : for (i = 0; i < nargs; i++) {
28853 : Py_INCREF(args[i]);
28854 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
28855 : }
28856 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
28857 : bad:
28858 : Py_DECREF(argstuple);
28859 : return result;
28860 : }
28861 : #endif
28862 7251 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
28863 7251 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
28864 : #if CYTHON_COMPILING_IN_CPYTHON
28865 7251 : if (nargs == 0 && kwargs == NULL) {
28866 6222 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
28867 0 : return __Pyx_PyObject_CallMethO(func, NULL);
28868 : }
28869 1029 : else if (nargs == 1 && kwargs == NULL) {
28870 1011 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
28871 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
28872 : }
28873 : #endif
28874 : #if PY_VERSION_HEX < 0x030800B1
28875 : #if CYTHON_FAST_PYCCALL
28876 : if (PyCFunction_Check(func)) {
28877 : if (kwargs) {
28878 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
28879 : } else {
28880 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
28881 : }
28882 : }
28883 : #if PY_VERSION_HEX >= 0x030700A1
28884 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
28885 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
28886 : }
28887 : #endif
28888 : #endif
28889 : #if CYTHON_FAST_PYCALL
28890 : if (PyFunction_Check(func)) {
28891 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
28892 : }
28893 : #endif
28894 : #endif
28895 7251 : if (kwargs == NULL) {
28896 : #if CYTHON_VECTORCALL
28897 : #if PY_VERSION_HEX < 0x03090000
28898 : vectorcallfunc f = _PyVectorcall_Function(func);
28899 : #else
28900 7251 : vectorcallfunc f = PyVectorcall_Function(func);
28901 : #endif
28902 7251 : if (f) {
28903 7239 : return f(func, args, (size_t)nargs, NULL);
28904 : }
28905 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
28906 : if (__Pyx_CyFunction_CheckExact(func)) {
28907 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
28908 : if (f) return f(func, args, (size_t)nargs, NULL);
28909 : }
28910 : #endif
28911 : }
28912 12 : if (nargs == 0) {
28913 0 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
28914 : }
28915 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
28916 12 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
28917 : #else
28918 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
28919 : #endif
28920 : }
28921 :
28922 : /* RaiseUnexpectedTypeError */
28923 : static int
28924 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
28925 : {
28926 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
28927 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
28928 : expected, obj_type_name);
28929 0 : __Pyx_DECREF_TypeName(obj_type_name);
28930 0 : return 0;
28931 : }
28932 :
28933 : /* CIntToDigits */
28934 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
28935 : "00010203040506070809"
28936 : "10111213141516171819"
28937 : "20212223242526272829"
28938 : "30313233343536373839"
28939 : "40414243444546474849"
28940 : "50515253545556575859"
28941 : "60616263646566676869"
28942 : "70717273747576777879"
28943 : "80818283848586878889"
28944 : "90919293949596979899"
28945 : };
28946 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
28947 : "0001020304050607"
28948 : "1011121314151617"
28949 : "2021222324252627"
28950 : "3031323334353637"
28951 : "4041424344454647"
28952 : "5051525354555657"
28953 : "6061626364656667"
28954 : "7071727374757677"
28955 : };
28956 : static const char DIGITS_HEX[2*16+1] = {
28957 : "0123456789abcdef"
28958 : "0123456789ABCDEF"
28959 : };
28960 :
28961 : /* BuildPyUnicode */
28962 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
28963 : int prepend_sign, char padding_char) {
28964 0 : PyObject *uval;
28965 0 : Py_ssize_t uoffset = ulength - clength;
28966 : #if CYTHON_USE_UNICODE_INTERNALS
28967 0 : Py_ssize_t i;
28968 : #if CYTHON_PEP393_ENABLED
28969 0 : void *udata;
28970 0 : uval = PyUnicode_New(ulength, 127);
28971 0 : if (unlikely(!uval)) return NULL;
28972 0 : udata = PyUnicode_DATA(uval);
28973 : #else
28974 : Py_UNICODE *udata;
28975 : uval = PyUnicode_FromUnicode(NULL, ulength);
28976 : if (unlikely(!uval)) return NULL;
28977 : udata = PyUnicode_AS_UNICODE(uval);
28978 : #endif
28979 0 : if (uoffset > 0) {
28980 0 : i = 0;
28981 0 : if (prepend_sign) {
28982 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
28983 0 : i++;
28984 : }
28985 0 : for (; i < uoffset; i++) {
28986 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
28987 : }
28988 : }
28989 0 : for (i=0; i < clength; i++) {
28990 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
28991 : }
28992 : #else
28993 : {
28994 : PyObject *sign = NULL, *padding = NULL;
28995 : uval = NULL;
28996 : if (uoffset > 0) {
28997 : prepend_sign = !!prepend_sign;
28998 : if (uoffset > prepend_sign) {
28999 : padding = PyUnicode_FromOrdinal(padding_char);
29000 : if (likely(padding) && uoffset > prepend_sign + 1) {
29001 : PyObject *tmp;
29002 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
29003 : if (unlikely(!repeat)) goto done_or_error;
29004 : tmp = PyNumber_Multiply(padding, repeat);
29005 : Py_DECREF(repeat);
29006 : Py_DECREF(padding);
29007 : padding = tmp;
29008 : }
29009 : if (unlikely(!padding)) goto done_or_error;
29010 : }
29011 : if (prepend_sign) {
29012 : sign = PyUnicode_FromOrdinal('-');
29013 : if (unlikely(!sign)) goto done_or_error;
29014 : }
29015 : }
29016 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
29017 : if (likely(uval) && padding) {
29018 : PyObject *tmp = PyNumber_Add(padding, uval);
29019 : Py_DECREF(uval);
29020 : uval = tmp;
29021 : }
29022 : if (likely(uval) && sign) {
29023 : PyObject *tmp = PyNumber_Add(sign, uval);
29024 : Py_DECREF(uval);
29025 : uval = tmp;
29026 : }
29027 : done_or_error:
29028 : Py_XDECREF(padding);
29029 : Py_XDECREF(sign);
29030 : }
29031 : #endif
29032 : return uval;
29033 : }
29034 :
29035 : /* CIntToPyUnicode */
29036 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
29037 0 : char digits[sizeof(int)*3+2];
29038 0 : char *dpos, *end = digits + sizeof(int)*3+2;
29039 0 : const char *hex_digits = DIGITS_HEX;
29040 0 : Py_ssize_t length, ulength;
29041 0 : int prepend_sign, last_one_off;
29042 0 : int remaining;
29043 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29044 0 : #pragma GCC diagnostic push
29045 0 : #pragma GCC diagnostic ignored "-Wconversion"
29046 : #endif
29047 0 : const int neg_one = (int) -1, const_zero = (int) 0;
29048 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29049 0 : #pragma GCC diagnostic pop
29050 : #endif
29051 0 : const int is_unsigned = neg_one > const_zero;
29052 0 : if (format_char == 'X') {
29053 0 : hex_digits += 16;
29054 0 : format_char = 'x';
29055 : }
29056 0 : remaining = value;
29057 0 : last_one_off = 0;
29058 0 : dpos = end;
29059 0 : do {
29060 0 : int digit_pos;
29061 0 : switch (format_char) {
29062 0 : case 'o':
29063 0 : digit_pos = abs((int)(remaining % (8*8)));
29064 0 : remaining = (int) (remaining / (8*8));
29065 0 : dpos -= 2;
29066 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29067 0 : last_one_off = (digit_pos < 8);
29068 0 : break;
29069 0 : case 'd':
29070 0 : digit_pos = abs((int)(remaining % (10*10)));
29071 0 : remaining = (int) (remaining / (10*10));
29072 0 : dpos -= 2;
29073 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29074 0 : last_one_off = (digit_pos < 10);
29075 0 : break;
29076 0 : case 'x':
29077 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29078 0 : remaining = (int) (remaining / 16);
29079 0 : break;
29080 : default:
29081 : assert(0);
29082 : break;
29083 : }
29084 0 : } while (unlikely(remaining != 0));
29085 0 : assert(!last_one_off || *dpos == '0');
29086 0 : dpos += last_one_off;
29087 0 : length = end - dpos;
29088 0 : ulength = length;
29089 0 : prepend_sign = 0;
29090 0 : if (!is_unsigned && value <= neg_one) {
29091 0 : if (padding_char == ' ' || width <= length + 1) {
29092 0 : *(--dpos) = '-';
29093 0 : ++length;
29094 : } else {
29095 : prepend_sign = 1;
29096 : }
29097 0 : ++ulength;
29098 : }
29099 0 : if (width > ulength) {
29100 : ulength = width;
29101 : }
29102 0 : if (ulength == 1) {
29103 0 : return PyUnicode_FromOrdinal(*dpos);
29104 : }
29105 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29106 : }
29107 :
29108 : /* CIntToPyUnicode */
29109 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
29110 0 : char digits[sizeof(Py_ssize_t)*3+2];
29111 0 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
29112 0 : const char *hex_digits = DIGITS_HEX;
29113 0 : Py_ssize_t length, ulength;
29114 0 : int prepend_sign, last_one_off;
29115 0 : Py_ssize_t remaining;
29116 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29117 0 : #pragma GCC diagnostic push
29118 0 : #pragma GCC diagnostic ignored "-Wconversion"
29119 : #endif
29120 0 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
29121 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29122 0 : #pragma GCC diagnostic pop
29123 : #endif
29124 0 : const int is_unsigned = neg_one > const_zero;
29125 0 : if (format_char == 'X') {
29126 0 : hex_digits += 16;
29127 0 : format_char = 'x';
29128 : }
29129 0 : remaining = value;
29130 0 : last_one_off = 0;
29131 0 : dpos = end;
29132 0 : do {
29133 0 : int digit_pos;
29134 0 : switch (format_char) {
29135 0 : case 'o':
29136 0 : digit_pos = abs((int)(remaining % (8*8)));
29137 0 : remaining = (Py_ssize_t) (remaining / (8*8));
29138 0 : dpos -= 2;
29139 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29140 0 : last_one_off = (digit_pos < 8);
29141 0 : break;
29142 0 : case 'd':
29143 0 : digit_pos = abs((int)(remaining % (10*10)));
29144 0 : remaining = (Py_ssize_t) (remaining / (10*10));
29145 0 : dpos -= 2;
29146 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29147 0 : last_one_off = (digit_pos < 10);
29148 0 : break;
29149 0 : case 'x':
29150 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29151 0 : remaining = (Py_ssize_t) (remaining / 16);
29152 0 : break;
29153 : default:
29154 : assert(0);
29155 : break;
29156 : }
29157 0 : } while (unlikely(remaining != 0));
29158 0 : assert(!last_one_off || *dpos == '0');
29159 0 : dpos += last_one_off;
29160 0 : length = end - dpos;
29161 0 : ulength = length;
29162 0 : prepend_sign = 0;
29163 0 : if (!is_unsigned && value <= neg_one) {
29164 0 : if (padding_char == ' ' || width <= length + 1) {
29165 0 : *(--dpos) = '-';
29166 0 : ++length;
29167 : } else {
29168 : prepend_sign = 1;
29169 : }
29170 0 : ++ulength;
29171 : }
29172 0 : if (width > ulength) {
29173 : ulength = width;
29174 : }
29175 0 : if (ulength == 1) {
29176 0 : return PyUnicode_FromOrdinal(*dpos);
29177 : }
29178 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29179 : }
29180 :
29181 : /* JoinPyUnicode */
29182 68 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
29183 : Py_UCS4 max_char) {
29184 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29185 68 : PyObject *result_uval;
29186 68 : int result_ukind, kind_shift;
29187 68 : Py_ssize_t i, char_pos;
29188 68 : void *result_udata;
29189 68 : CYTHON_MAYBE_UNUSED_VAR(max_char);
29190 : #if CYTHON_PEP393_ENABLED
29191 68 : result_uval = PyUnicode_New(result_ulength, max_char);
29192 68 : if (unlikely(!result_uval)) return NULL;
29193 68 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
29194 68 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
29195 68 : result_udata = PyUnicode_DATA(result_uval);
29196 : #else
29197 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
29198 : if (unlikely(!result_uval)) return NULL;
29199 : result_ukind = sizeof(Py_UNICODE);
29200 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
29201 : result_udata = PyUnicode_AS_UNICODE(result_uval);
29202 : #endif
29203 68 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
29204 68 : char_pos = 0;
29205 386 : for (i=0; i < value_count; i++) {
29206 318 : int ukind;
29207 318 : Py_ssize_t ulength;
29208 318 : void *udata;
29209 318 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
29210 318 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
29211 : goto bad;
29212 318 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
29213 318 : if (unlikely(!ulength))
29214 0 : continue;
29215 318 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
29216 0 : goto overflow;
29217 318 : ukind = __Pyx_PyUnicode_KIND(uval);
29218 318 : udata = __Pyx_PyUnicode_DATA(uval);
29219 318 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
29220 318 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
29221 : } else {
29222 : #if PY_VERSION_HEX >= 0x030d0000
29223 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
29224 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
29225 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
29226 : #else
29227 : Py_ssize_t j;
29228 : for (j=0; j < ulength; j++) {
29229 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
29230 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
29231 : }
29232 : #endif
29233 : }
29234 318 : char_pos += ulength;
29235 : }
29236 : return result_uval;
29237 0 : overflow:
29238 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
29239 0 : bad:
29240 0 : Py_DECREF(result_uval);
29241 : return NULL;
29242 : #else
29243 : CYTHON_UNUSED_VAR(max_char);
29244 : CYTHON_UNUSED_VAR(result_ulength);
29245 : CYTHON_UNUSED_VAR(value_count);
29246 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
29247 : #endif
29248 : }
29249 :
29250 : /* GetAttr */
29251 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29252 : #if CYTHON_USE_TYPE_SLOTS
29253 : #if PY_MAJOR_VERSION >= 3
29254 0 : if (likely(PyUnicode_Check(n)))
29255 : #else
29256 : if (likely(PyString_Check(n)))
29257 : #endif
29258 0 : return __Pyx_PyObject_GetAttrStr(o, n);
29259 : #endif
29260 0 : return PyObject_GetAttr(o, n);
29261 : }
29262 :
29263 : /* GetItemInt */
29264 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29265 0 : PyObject *r;
29266 0 : if (unlikely(!j)) return NULL;
29267 0 : r = PyObject_GetItem(o, j);
29268 0 : Py_DECREF(j);
29269 : return r;
29270 : }
29271 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29272 : CYTHON_NCP_UNUSED int wraparound,
29273 : CYTHON_NCP_UNUSED int boundscheck) {
29274 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29275 : Py_ssize_t wrapped_i = i;
29276 : if (wraparound & unlikely(i < 0)) {
29277 : wrapped_i += PyList_GET_SIZE(o);
29278 : }
29279 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29280 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29281 : Py_INCREF(r);
29282 : return r;
29283 : }
29284 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29285 : #else
29286 : return PySequence_GetItem(o, i);
29287 : #endif
29288 : }
29289 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29290 : CYTHON_NCP_UNUSED int wraparound,
29291 : CYTHON_NCP_UNUSED int boundscheck) {
29292 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29293 0 : Py_ssize_t wrapped_i = i;
29294 0 : if (wraparound & unlikely(i < 0)) {
29295 0 : wrapped_i += PyTuple_GET_SIZE(o);
29296 : }
29297 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29298 0 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29299 0 : Py_INCREF(r);
29300 0 : return r;
29301 : }
29302 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29303 : #else
29304 : return PySequence_GetItem(o, i);
29305 : #endif
29306 : }
29307 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29308 : CYTHON_NCP_UNUSED int wraparound,
29309 : CYTHON_NCP_UNUSED int boundscheck) {
29310 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29311 0 : if (is_list || PyList_CheckExact(o)) {
29312 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29313 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29314 0 : PyObject *r = PyList_GET_ITEM(o, n);
29315 0 : Py_INCREF(r);
29316 0 : return r;
29317 : }
29318 : }
29319 0 : else if (PyTuple_CheckExact(o)) {
29320 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29321 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29322 0 : PyObject *r = PyTuple_GET_ITEM(o, n);
29323 0 : Py_INCREF(r);
29324 0 : return r;
29325 : }
29326 : } else {
29327 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
29328 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
29329 0 : if (mm && mm->mp_subscript) {
29330 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
29331 0 : if (unlikely(!key)) return NULL;
29332 0 : r = mm->mp_subscript(o, key);
29333 0 : Py_DECREF(key);
29334 0 : return r;
29335 : }
29336 0 : if (likely(sm && sm->sq_item)) {
29337 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
29338 0 : Py_ssize_t l = sm->sq_length(o);
29339 0 : if (likely(l >= 0)) {
29340 0 : i += l;
29341 : } else {
29342 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29343 : return NULL;
29344 0 : PyErr_Clear();
29345 : }
29346 : }
29347 0 : return sm->sq_item(o, i);
29348 : }
29349 : }
29350 : #else
29351 : if (is_list || !PyMapping_Check(o)) {
29352 : return PySequence_GetItem(o, i);
29353 : }
29354 : #endif
29355 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29356 : }
29357 :
29358 : /* PyObjectCallOneArg */
29359 14 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29360 14 : PyObject *args[2] = {NULL, arg};
29361 14 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29362 : }
29363 :
29364 : /* ObjectGetItem */
29365 : #if CYTHON_USE_TYPE_SLOTS
29366 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
29367 0 : PyObject *runerr = NULL;
29368 0 : Py_ssize_t key_value;
29369 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
29370 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29371 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29372 : }
29373 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29374 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
29375 0 : PyErr_Clear();
29376 0 : PyErr_Format(PyExc_IndexError,
29377 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
29378 0 : __Pyx_DECREF_TypeName(index_type_name);
29379 : }
29380 : return NULL;
29381 : }
29382 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
29383 0 : __Pyx_TypeName obj_type_name;
29384 0 : if (likely(PyType_Check(obj))) {
29385 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
29386 0 : if (!meth) {
29387 0 : PyErr_Clear();
29388 : } else {
29389 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
29390 0 : Py_DECREF(meth);
29391 0 : return result;
29392 : }
29393 : }
29394 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29395 0 : PyErr_Format(PyExc_TypeError,
29396 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
29397 0 : __Pyx_DECREF_TypeName(obj_type_name);
29398 0 : return NULL;
29399 : }
29400 0 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
29401 0 : PyTypeObject *tp = Py_TYPE(obj);
29402 0 : PyMappingMethods *mm = tp->tp_as_mapping;
29403 0 : PySequenceMethods *sm = tp->tp_as_sequence;
29404 0 : if (likely(mm && mm->mp_subscript)) {
29405 0 : return mm->mp_subscript(obj, key);
29406 : }
29407 0 : if (likely(sm && sm->sq_item)) {
29408 0 : return __Pyx_PyObject_GetIndex(obj, key);
29409 : }
29410 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
29411 : }
29412 : #endif
29413 :
29414 : /* KeywordStringCheck */
29415 0 : static int __Pyx_CheckKeywordStrings(
29416 : PyObject *kw,
29417 : const char* function_name,
29418 : int kw_allowed)
29419 : {
29420 0 : PyObject* key = 0;
29421 0 : Py_ssize_t pos = 0;
29422 : #if CYTHON_COMPILING_IN_PYPY
29423 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
29424 : goto invalid_keyword;
29425 : return 1;
29426 : #else
29427 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
29428 0 : Py_ssize_t kwsize;
29429 : #if CYTHON_ASSUME_SAFE_MACROS
29430 0 : kwsize = PyTuple_GET_SIZE(kw);
29431 : #else
29432 : kwsize = PyTuple_Size(kw);
29433 : if (kwsize < 0) return 0;
29434 : #endif
29435 0 : if (unlikely(kwsize == 0))
29436 : return 1;
29437 0 : if (!kw_allowed) {
29438 : #if CYTHON_ASSUME_SAFE_MACROS
29439 0 : key = PyTuple_GET_ITEM(kw, 0);
29440 : #else
29441 : key = PyTuple_GetItem(kw, pos);
29442 : if (!key) return 0;
29443 : #endif
29444 0 : goto invalid_keyword;
29445 : }
29446 : #if PY_VERSION_HEX < 0x03090000
29447 : for (pos = 0; pos < kwsize; pos++) {
29448 : #if CYTHON_ASSUME_SAFE_MACROS
29449 : key = PyTuple_GET_ITEM(kw, pos);
29450 : #else
29451 : key = PyTuple_GetItem(kw, pos);
29452 : if (!key) return 0;
29453 : #endif
29454 : if (unlikely(!PyUnicode_Check(key)))
29455 : goto invalid_keyword_type;
29456 : }
29457 : #endif
29458 : return 1;
29459 : }
29460 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
29461 : #if PY_MAJOR_VERSION < 3
29462 : if (unlikely(!PyString_Check(key)))
29463 : #endif
29464 0 : if (unlikely(!PyUnicode_Check(key)))
29465 0 : goto invalid_keyword_type;
29466 : }
29467 0 : if (!kw_allowed && unlikely(key))
29468 0 : goto invalid_keyword;
29469 : return 1;
29470 0 : invalid_keyword_type:
29471 0 : PyErr_Format(PyExc_TypeError,
29472 : "%.200s() keywords must be strings", function_name);
29473 : return 0;
29474 : #endif
29475 0 : invalid_keyword:
29476 : #if PY_MAJOR_VERSION < 3
29477 : PyErr_Format(PyExc_TypeError,
29478 : "%.200s() got an unexpected keyword argument '%.200s'",
29479 : function_name, PyString_AsString(key));
29480 : #else
29481 0 : PyErr_Format(PyExc_TypeError,
29482 : "%s() got an unexpected keyword argument '%U'",
29483 : function_name, key);
29484 : #endif
29485 : return 0;
29486 : }
29487 :
29488 : /* DivInt[Py_ssize_t] */
29489 0 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
29490 0 : Py_ssize_t q = a / b;
29491 0 : Py_ssize_t r = a - q*b;
29492 0 : q -= ((r != 0) & ((r ^ b) < 0));
29493 0 : return q;
29494 : }
29495 :
29496 : /* GetAttr3 */
29497 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
29498 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29499 0 : __Pyx_PyThreadState_declare
29500 0 : __Pyx_PyThreadState_assign
29501 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29502 : return NULL;
29503 0 : __Pyx_PyErr_Clear();
29504 0 : Py_INCREF(d);
29505 : return d;
29506 : }
29507 : #endif
29508 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29509 0 : PyObject *r;
29510 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
29511 : int res = PyObject_GetOptionalAttr(o, n, &r);
29512 : return (res != 0) ? r : __Pyx_NewRef(d);
29513 : #else
29514 : #if CYTHON_USE_TYPE_SLOTS
29515 0 : if (likely(PyString_Check(n))) {
29516 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
29517 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
29518 0 : r = __Pyx_NewRef(d);
29519 : }
29520 0 : return r;
29521 : }
29522 : #endif
29523 0 : r = PyObject_GetAttr(o, n);
29524 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29525 : #endif
29526 : }
29527 :
29528 : /* PyDictVersioning */
29529 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
29530 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
29531 : PyObject *dict = Py_TYPE(obj)->tp_dict;
29532 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
29533 : }
29534 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
29535 : PyObject **dictptr = NULL;
29536 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
29537 : if (offset) {
29538 : #if CYTHON_COMPILING_IN_CPYTHON
29539 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
29540 : #else
29541 : dictptr = _PyObject_GetDictPtr(obj);
29542 : #endif
29543 : }
29544 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
29545 : }
29546 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
29547 : PyObject *dict = Py_TYPE(obj)->tp_dict;
29548 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
29549 : return 0;
29550 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
29551 : }
29552 : #endif
29553 :
29554 : /* GetModuleGlobalName */
29555 : #if CYTHON_USE_DICT_VERSIONS
29556 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
29557 : #else
29558 1043 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
29559 : #endif
29560 : {
29561 1043 : PyObject *result;
29562 : #if !CYTHON_AVOID_BORROWED_REFS
29563 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
29564 1043 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29565 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29566 1043 : if (likely(result)) {
29567 1043 : return __Pyx_NewRef(result);
29568 0 : } else if (unlikely(PyErr_Occurred())) {
29569 : return NULL;
29570 : }
29571 : #elif CYTHON_COMPILING_IN_LIMITED_API
29572 : if (unlikely(!__pyx_m)) {
29573 : return NULL;
29574 : }
29575 : result = PyObject_GetAttr(__pyx_m, name);
29576 : if (likely(result)) {
29577 : return result;
29578 : }
29579 : #else
29580 : result = PyDict_GetItem(__pyx_d, name);
29581 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29582 : if (likely(result)) {
29583 : return __Pyx_NewRef(result);
29584 : }
29585 : #endif
29586 : #else
29587 : result = PyObject_GetItem(__pyx_d, name);
29588 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29589 : if (likely(result)) {
29590 : return __Pyx_NewRef(result);
29591 : }
29592 : PyErr_Clear();
29593 : #endif
29594 0 : return __Pyx_GetBuiltinName(name);
29595 : }
29596 :
29597 : /* RaiseTooManyValuesToUnpack */
29598 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29599 0 : PyErr_Format(PyExc_ValueError,
29600 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
29601 0 : }
29602 :
29603 : /* RaiseNeedMoreValuesToUnpack */
29604 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29605 0 : PyErr_Format(PyExc_ValueError,
29606 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
29607 : index, (index == 1) ? "" : "s");
29608 0 : }
29609 :
29610 : /* RaiseNoneIterError */
29611 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29612 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29613 : }
29614 :
29615 : /* ExtTypeTest */
29616 2796 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29617 2796 : __Pyx_TypeName obj_type_name;
29618 2796 : __Pyx_TypeName type_name;
29619 2796 : if (unlikely(!type)) {
29620 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
29621 0 : return 0;
29622 : }
29623 2796 : if (likely(__Pyx_TypeCheck(obj, type)))
29624 : return 1;
29625 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29626 0 : type_name = __Pyx_PyType_GetName(type);
29627 0 : PyErr_Format(PyExc_TypeError,
29628 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
29629 : obj_type_name, type_name);
29630 0 : __Pyx_DECREF_TypeName(obj_type_name);
29631 0 : __Pyx_DECREF_TypeName(type_name);
29632 0 : return 0;
29633 : }
29634 :
29635 : /* GetTopmostException */
29636 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
29637 : static _PyErr_StackItem *
29638 5 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29639 : {
29640 5 : _PyErr_StackItem *exc_info = tstate->exc_info;
29641 25 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
29642 25 : exc_info->previous_item != NULL)
29643 : {
29644 : exc_info = exc_info->previous_item;
29645 : }
29646 5 : return exc_info;
29647 : }
29648 : #endif
29649 :
29650 : /* SaveResetException */
29651 : #if CYTHON_FAST_THREAD_STATE
29652 5 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29653 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
29654 5 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29655 5 : PyObject *exc_value = exc_info->exc_value;
29656 5 : if (exc_value == NULL || exc_value == Py_None) {
29657 5 : *value = NULL;
29658 5 : *type = NULL;
29659 5 : *tb = NULL;
29660 : } else {
29661 0 : *value = exc_value;
29662 0 : Py_INCREF(*value);
29663 0 : *type = (PyObject*) Py_TYPE(exc_value);
29664 0 : Py_INCREF(*type);
29665 0 : *tb = PyException_GetTraceback(exc_value);
29666 : }
29667 : #elif CYTHON_USE_EXC_INFO_STACK
29668 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29669 : *type = exc_info->exc_type;
29670 : *value = exc_info->exc_value;
29671 : *tb = exc_info->exc_traceback;
29672 : Py_XINCREF(*type);
29673 : Py_XINCREF(*value);
29674 : Py_XINCREF(*tb);
29675 : #else
29676 : *type = tstate->exc_type;
29677 : *value = tstate->exc_value;
29678 : *tb = tstate->exc_traceback;
29679 : Py_XINCREF(*type);
29680 : Py_XINCREF(*value);
29681 : Py_XINCREF(*tb);
29682 : #endif
29683 5 : }
29684 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29685 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
29686 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
29687 0 : PyObject *tmp_value = exc_info->exc_value;
29688 0 : exc_info->exc_value = value;
29689 0 : Py_XDECREF(tmp_value);
29690 0 : Py_XDECREF(type);
29691 0 : Py_XDECREF(tb);
29692 : #else
29693 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29694 : #if CYTHON_USE_EXC_INFO_STACK
29695 : _PyErr_StackItem *exc_info = tstate->exc_info;
29696 : tmp_type = exc_info->exc_type;
29697 : tmp_value = exc_info->exc_value;
29698 : tmp_tb = exc_info->exc_traceback;
29699 : exc_info->exc_type = type;
29700 : exc_info->exc_value = value;
29701 : exc_info->exc_traceback = tb;
29702 : #else
29703 : tmp_type = tstate->exc_type;
29704 : tmp_value = tstate->exc_value;
29705 : tmp_tb = tstate->exc_traceback;
29706 : tstate->exc_type = type;
29707 : tstate->exc_value = value;
29708 : tstate->exc_traceback = tb;
29709 : #endif
29710 : Py_XDECREF(tmp_type);
29711 : Py_XDECREF(tmp_value);
29712 : Py_XDECREF(tmp_tb);
29713 : #endif
29714 0 : }
29715 : #endif
29716 :
29717 : /* GetException */
29718 : #if CYTHON_FAST_THREAD_STATE
29719 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29720 : #else
29721 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29722 : #endif
29723 : {
29724 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
29725 : #if CYTHON_FAST_THREAD_STATE
29726 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29727 : #if PY_VERSION_HEX >= 0x030C00A6
29728 0 : local_value = tstate->current_exception;
29729 0 : tstate->current_exception = 0;
29730 0 : if (likely(local_value)) {
29731 0 : local_type = (PyObject*) Py_TYPE(local_value);
29732 0 : Py_INCREF(local_type);
29733 0 : local_tb = PyException_GetTraceback(local_value);
29734 : }
29735 : #else
29736 : local_type = tstate->curexc_type;
29737 : local_value = tstate->curexc_value;
29738 : local_tb = tstate->curexc_traceback;
29739 : tstate->curexc_type = 0;
29740 : tstate->curexc_value = 0;
29741 : tstate->curexc_traceback = 0;
29742 : #endif
29743 : #else
29744 : PyErr_Fetch(&local_type, &local_value, &local_tb);
29745 : #endif
29746 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29747 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
29748 0 : if (unlikely(tstate->current_exception))
29749 : #elif CYTHON_FAST_THREAD_STATE
29750 : if (unlikely(tstate->curexc_type))
29751 : #else
29752 : if (unlikely(PyErr_Occurred()))
29753 : #endif
29754 0 : goto bad;
29755 : #if PY_MAJOR_VERSION >= 3
29756 0 : if (local_tb) {
29757 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29758 0 : goto bad;
29759 : }
29760 : #endif
29761 0 : Py_XINCREF(local_tb);
29762 0 : Py_XINCREF(local_type);
29763 0 : Py_XINCREF(local_value);
29764 0 : *type = local_type;
29765 0 : *value = local_value;
29766 0 : *tb = local_tb;
29767 : #if CYTHON_FAST_THREAD_STATE
29768 : #if CYTHON_USE_EXC_INFO_STACK
29769 0 : {
29770 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
29771 : #if PY_VERSION_HEX >= 0x030B00a4
29772 0 : tmp_value = exc_info->exc_value;
29773 0 : exc_info->exc_value = local_value;
29774 0 : tmp_type = NULL;
29775 0 : tmp_tb = NULL;
29776 0 : Py_XDECREF(local_type);
29777 0 : Py_XDECREF(local_tb);
29778 : #else
29779 : tmp_type = exc_info->exc_type;
29780 : tmp_value = exc_info->exc_value;
29781 : tmp_tb = exc_info->exc_traceback;
29782 : exc_info->exc_type = local_type;
29783 : exc_info->exc_value = local_value;
29784 : exc_info->exc_traceback = local_tb;
29785 : #endif
29786 : }
29787 : #else
29788 : tmp_type = tstate->exc_type;
29789 : tmp_value = tstate->exc_value;
29790 : tmp_tb = tstate->exc_traceback;
29791 : tstate->exc_type = local_type;
29792 : tstate->exc_value = local_value;
29793 : tstate->exc_traceback = local_tb;
29794 : #endif
29795 0 : Py_XDECREF(tmp_type);
29796 0 : Py_XDECREF(tmp_value);
29797 0 : Py_XDECREF(tmp_tb);
29798 : #else
29799 : PyErr_SetExcInfo(local_type, local_value, local_tb);
29800 : #endif
29801 : return 0;
29802 0 : bad:
29803 0 : *type = 0;
29804 0 : *value = 0;
29805 0 : *tb = 0;
29806 0 : Py_XDECREF(local_type);
29807 0 : Py_XDECREF(local_value);
29808 0 : Py_XDECREF(local_tb);
29809 : return -1;
29810 : }
29811 :
29812 : /* SwapException */
29813 : #if CYTHON_FAST_THREAD_STATE
29814 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29815 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29816 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
29817 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
29818 0 : tmp_value = exc_info->exc_value;
29819 0 : exc_info->exc_value = *value;
29820 0 : if (tmp_value == NULL || tmp_value == Py_None) {
29821 0 : Py_XDECREF(tmp_value);
29822 0 : tmp_value = NULL;
29823 0 : tmp_type = NULL;
29824 0 : tmp_tb = NULL;
29825 : } else {
29826 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
29827 0 : Py_INCREF(tmp_type);
29828 : #if CYTHON_COMPILING_IN_CPYTHON
29829 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
29830 0 : Py_XINCREF(tmp_tb);
29831 : #else
29832 : tmp_tb = PyException_GetTraceback(tmp_value);
29833 : #endif
29834 : }
29835 : #elif CYTHON_USE_EXC_INFO_STACK
29836 : _PyErr_StackItem *exc_info = tstate->exc_info;
29837 : tmp_type = exc_info->exc_type;
29838 : tmp_value = exc_info->exc_value;
29839 : tmp_tb = exc_info->exc_traceback;
29840 : exc_info->exc_type = *type;
29841 : exc_info->exc_value = *value;
29842 : exc_info->exc_traceback = *tb;
29843 : #else
29844 : tmp_type = tstate->exc_type;
29845 : tmp_value = tstate->exc_value;
29846 : tmp_tb = tstate->exc_traceback;
29847 : tstate->exc_type = *type;
29848 : tstate->exc_value = *value;
29849 : tstate->exc_traceback = *tb;
29850 : #endif
29851 0 : *type = tmp_type;
29852 0 : *value = tmp_value;
29853 0 : *tb = tmp_tb;
29854 0 : }
29855 : #else
29856 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
29857 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29858 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
29859 : PyErr_SetExcInfo(*type, *value, *tb);
29860 : *type = tmp_type;
29861 : *value = tmp_value;
29862 : *tb = tmp_tb;
29863 : }
29864 : #endif
29865 :
29866 : /* Import */
29867 2 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
29868 2 : PyObject *module = 0;
29869 2 : PyObject *empty_dict = 0;
29870 2 : PyObject *empty_list = 0;
29871 : #if PY_MAJOR_VERSION < 3
29872 : PyObject *py_import;
29873 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
29874 : if (unlikely(!py_import))
29875 : goto bad;
29876 : if (!from_list) {
29877 : empty_list = PyList_New(0);
29878 : if (unlikely(!empty_list))
29879 : goto bad;
29880 : from_list = empty_list;
29881 : }
29882 : #endif
29883 2 : empty_dict = PyDict_New();
29884 2 : if (unlikely(!empty_dict))
29885 0 : goto bad;
29886 2 : {
29887 : #if PY_MAJOR_VERSION >= 3
29888 2 : if (level == -1) {
29889 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
29890 0 : module = PyImport_ImportModuleLevelObject(
29891 : name, __pyx_d, empty_dict, from_list, 1);
29892 0 : if (unlikely(!module)) {
29893 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
29894 0 : goto bad;
29895 0 : PyErr_Clear();
29896 : }
29897 : }
29898 0 : level = 0;
29899 : }
29900 : #endif
29901 0 : if (!module) {
29902 : #if PY_MAJOR_VERSION < 3
29903 : PyObject *py_level = PyInt_FromLong(level);
29904 : if (unlikely(!py_level))
29905 : goto bad;
29906 : module = PyObject_CallFunctionObjArgs(py_import,
29907 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
29908 : Py_DECREF(py_level);
29909 : #else
29910 2 : module = PyImport_ImportModuleLevelObject(
29911 : name, __pyx_d, empty_dict, from_list, level);
29912 : #endif
29913 : }
29914 : }
29915 2 : bad:
29916 2 : Py_XDECREF(empty_dict);
29917 2 : Py_XDECREF(empty_list);
29918 : #if PY_MAJOR_VERSION < 3
29919 : Py_XDECREF(py_import);
29920 : #endif
29921 2 : return module;
29922 : }
29923 :
29924 : /* ImportDottedModule */
29925 : #if PY_MAJOR_VERSION >= 3
29926 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
29927 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
29928 0 : if (unlikely(PyErr_Occurred())) {
29929 0 : PyErr_Clear();
29930 : }
29931 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
29932 : partial_name = name;
29933 : } else {
29934 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
29935 0 : if (unlikely(!slice))
29936 0 : goto bad;
29937 0 : sep = PyUnicode_FromStringAndSize(".", 1);
29938 0 : if (unlikely(!sep))
29939 0 : goto bad;
29940 0 : partial_name = PyUnicode_Join(sep, slice);
29941 : }
29942 0 : PyErr_Format(
29943 : #if PY_MAJOR_VERSION < 3
29944 : PyExc_ImportError,
29945 : "No module named '%s'", PyString_AS_STRING(partial_name));
29946 : #else
29947 : #if PY_VERSION_HEX >= 0x030600B1
29948 : PyExc_ModuleNotFoundError,
29949 : #else
29950 : PyExc_ImportError,
29951 : #endif
29952 : "No module named '%U'", partial_name);
29953 : #endif
29954 0 : bad:
29955 0 : Py_XDECREF(sep);
29956 0 : Py_XDECREF(slice);
29957 0 : Py_XDECREF(partial_name);
29958 0 : return NULL;
29959 : }
29960 : #endif
29961 : #if PY_MAJOR_VERSION >= 3
29962 2 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
29963 2 : PyObject *imported_module;
29964 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
29965 : PyObject *modules = PyImport_GetModuleDict();
29966 : if (unlikely(!modules))
29967 : return NULL;
29968 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
29969 : Py_XINCREF(imported_module);
29970 : #else
29971 4 : imported_module = PyImport_GetModule(name);
29972 : #endif
29973 2 : return imported_module;
29974 : }
29975 : #endif
29976 : #if PY_MAJOR_VERSION >= 3
29977 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
29978 0 : Py_ssize_t i, nparts;
29979 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
29980 0 : for (i=1; i < nparts && module; i++) {
29981 0 : PyObject *part, *submodule;
29982 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29983 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
29984 : #else
29985 : part = PySequence_ITEM(parts_tuple, i);
29986 : #endif
29987 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
29988 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
29989 : Py_DECREF(part);
29990 : #endif
29991 0 : Py_DECREF(module);
29992 0 : module = submodule;
29993 : }
29994 0 : if (unlikely(!module)) {
29995 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
29996 : }
29997 : return module;
29998 : }
29999 : #endif
30000 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30001 : #if PY_MAJOR_VERSION < 3
30002 : PyObject *module, *from_list, *star = __pyx_n_s__3;
30003 : CYTHON_UNUSED_VAR(parts_tuple);
30004 : from_list = PyList_New(1);
30005 : if (unlikely(!from_list))
30006 : return NULL;
30007 : Py_INCREF(star);
30008 : PyList_SET_ITEM(from_list, 0, star);
30009 : module = __Pyx_Import(name, from_list, 0);
30010 : Py_DECREF(from_list);
30011 : return module;
30012 : #else
30013 0 : PyObject *imported_module;
30014 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
30015 0 : if (!parts_tuple || unlikely(!module))
30016 : return module;
30017 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
30018 0 : if (likely(imported_module)) {
30019 0 : Py_DECREF(module);
30020 0 : return imported_module;
30021 : }
30022 0 : PyErr_Clear();
30023 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
30024 : #endif
30025 : }
30026 2 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30027 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
30028 2 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
30029 2 : if (likely(module)) {
30030 2 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
30031 2 : if (likely(spec)) {
30032 2 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
30033 2 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
30034 2 : Py_DECREF(spec);
30035 : spec = NULL;
30036 : }
30037 2 : Py_XDECREF(unsafe);
30038 : }
30039 2 : if (likely(!spec)) {
30040 2 : PyErr_Clear();
30041 2 : return module;
30042 : }
30043 0 : Py_DECREF(spec);
30044 0 : Py_DECREF(module);
30045 0 : } else if (PyErr_Occurred()) {
30046 0 : PyErr_Clear();
30047 : }
30048 : #endif
30049 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
30050 : }
30051 :
30052 : /* FastTypeChecks */
30053 : #if CYTHON_COMPILING_IN_CPYTHON
30054 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30055 0 : while (a) {
30056 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
30057 0 : if (a == b)
30058 : return 1;
30059 : }
30060 0 : return b == &PyBaseObject_Type;
30061 : }
30062 15599 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30063 15599 : PyObject *mro;
30064 15599 : if (a == b) return 1;
30065 11404 : mro = a->tp_mro;
30066 11404 : if (likely(mro)) {
30067 11404 : Py_ssize_t i, n;
30068 11404 : n = PyTuple_GET_SIZE(mro);
30069 32814 : for (i = 0; i < n; i++) {
30070 22808 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30071 : return 1;
30072 : }
30073 : return 0;
30074 : }
30075 15599 : return __Pyx_InBases(a, b);
30076 : }
30077 7233 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
30078 7233 : PyObject *mro;
30079 7233 : if (cls == a || cls == b) return 1;
30080 14 : mro = cls->tp_mro;
30081 14 : if (likely(mro)) {
30082 14 : Py_ssize_t i, n;
30083 14 : n = PyTuple_GET_SIZE(mro);
30084 42 : for (i = 0; i < n; i++) {
30085 28 : PyObject *base = PyTuple_GET_ITEM(mro, i);
30086 28 : if (base == (PyObject *)a || base == (PyObject *)b)
30087 : return 1;
30088 : }
30089 : return 0;
30090 : }
30091 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
30092 : }
30093 : #if PY_MAJOR_VERSION == 2
30094 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30095 : PyObject *exception, *value, *tb;
30096 : int res;
30097 : __Pyx_PyThreadState_declare
30098 : __Pyx_PyThreadState_assign
30099 : __Pyx_ErrFetch(&exception, &value, &tb);
30100 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30101 : if (unlikely(res == -1)) {
30102 : PyErr_WriteUnraisable(err);
30103 : res = 0;
30104 : }
30105 : if (!res) {
30106 : res = PyObject_IsSubclass(err, exc_type2);
30107 : if (unlikely(res == -1)) {
30108 : PyErr_WriteUnraisable(err);
30109 : res = 0;
30110 : }
30111 : }
30112 : __Pyx_ErrRestore(exception, value, tb);
30113 : return res;
30114 : }
30115 : #else
30116 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30117 0 : if (exc_type1) {
30118 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
30119 : } else {
30120 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30121 : }
30122 : }
30123 : #endif
30124 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30125 0 : Py_ssize_t i, n;
30126 0 : assert(PyExceptionClass_Check(exc_type));
30127 0 : n = PyTuple_GET_SIZE(tuple);
30128 : #if PY_MAJOR_VERSION >= 3
30129 0 : for (i=0; i<n; i++) {
30130 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30131 : }
30132 : #endif
30133 0 : for (i=0; i<n; i++) {
30134 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
30135 : #if PY_MAJOR_VERSION < 3
30136 : if (likely(exc_type == t)) return 1;
30137 : #endif
30138 0 : if (likely(PyExceptionClass_Check(t))) {
30139 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30140 : } else {
30141 : }
30142 : }
30143 : return 0;
30144 : }
30145 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30146 0 : if (likely(err == exc_type)) return 1;
30147 0 : if (likely(PyExceptionClass_Check(err))) {
30148 0 : if (likely(PyExceptionClass_Check(exc_type))) {
30149 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30150 0 : } else if (likely(PyTuple_Check(exc_type))) {
30151 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30152 : } else {
30153 : }
30154 : }
30155 0 : return PyErr_GivenExceptionMatches(err, exc_type);
30156 : }
30157 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30158 : assert(PyExceptionClass_Check(exc_type1));
30159 : assert(PyExceptionClass_Check(exc_type2));
30160 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
30161 : if (likely(PyExceptionClass_Check(err))) {
30162 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30163 : }
30164 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30165 : }
30166 : #endif
30167 :
30168 : /* PySequenceMultiply */
30169 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
30170 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
30171 0 : if (unlikely(!pymul))
30172 : return NULL;
30173 0 : result = PyNumber_Multiply(seq, pymul);
30174 0 : Py_DECREF(pymul);
30175 : return result;
30176 : }
30177 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
30178 : #if CYTHON_USE_TYPE_SLOTS
30179 0 : PyTypeObject *type = Py_TYPE(seq);
30180 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
30181 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
30182 : } else
30183 : #endif
30184 : {
30185 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
30186 : }
30187 : }
30188 :
30189 : /* SetItemInt */
30190 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
30191 0 : int r;
30192 0 : if (unlikely(!j)) return -1;
30193 0 : r = PyObject_SetItem(o, j, v);
30194 0 : Py_DECREF(j);
30195 : return r;
30196 : }
30197 2796 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
30198 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
30199 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
30200 2796 : if (is_list || PyList_CheckExact(o)) {
30201 2796 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
30202 2796 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
30203 2796 : PyObject* old = PyList_GET_ITEM(o, n);
30204 2796 : Py_INCREF(v);
30205 2796 : PyList_SET_ITEM(o, n, v);
30206 2796 : Py_DECREF(old);
30207 2796 : return 1;
30208 : }
30209 : } else {
30210 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
30211 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
30212 0 : if (mm && mm->mp_ass_subscript) {
30213 0 : int r;
30214 0 : PyObject *key = PyInt_FromSsize_t(i);
30215 0 : if (unlikely(!key)) return -1;
30216 0 : r = mm->mp_ass_subscript(o, key, v);
30217 0 : Py_DECREF(key);
30218 0 : return r;
30219 : }
30220 0 : if (likely(sm && sm->sq_ass_item)) {
30221 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
30222 0 : Py_ssize_t l = sm->sq_length(o);
30223 0 : if (likely(l >= 0)) {
30224 0 : i += l;
30225 : } else {
30226 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30227 : return -1;
30228 0 : PyErr_Clear();
30229 : }
30230 : }
30231 0 : return sm->sq_ass_item(o, i, v);
30232 : }
30233 : }
30234 : #else
30235 : if (is_list || !PyMapping_Check(o))
30236 : {
30237 : return PySequence_SetItem(o, i, v);
30238 : }
30239 : #endif
30240 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
30241 : }
30242 :
30243 : /* RaiseUnboundLocalError */
30244 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30245 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30246 : }
30247 :
30248 : /* DivInt[long] */
30249 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
30250 0 : long q = a / b;
30251 0 : long r = a - q*b;
30252 0 : q -= ((r != 0) & ((r ^ b) < 0));
30253 0 : return q;
30254 : }
30255 :
30256 : /* ImportFrom */
30257 2 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30258 2 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30259 2 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30260 0 : const char* module_name_str = 0;
30261 0 : PyObject* module_name = 0;
30262 0 : PyObject* module_dot = 0;
30263 0 : PyObject* full_name = 0;
30264 0 : PyErr_Clear();
30265 0 : module_name_str = PyModule_GetName(module);
30266 0 : if (unlikely(!module_name_str)) { goto modbad; }
30267 0 : module_name = PyUnicode_FromString(module_name_str);
30268 0 : if (unlikely(!module_name)) { goto modbad; }
30269 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
30270 0 : if (unlikely(!module_dot)) { goto modbad; }
30271 0 : full_name = PyUnicode_Concat(module_dot, name);
30272 0 : if (unlikely(!full_name)) { goto modbad; }
30273 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
30274 : {
30275 : PyObject *modules = PyImport_GetModuleDict();
30276 : if (unlikely(!modules))
30277 : goto modbad;
30278 : value = PyObject_GetItem(modules, full_name);
30279 : }
30280 : #else
30281 0 : value = PyImport_GetModule(full_name);
30282 : #endif
30283 0 : modbad:
30284 0 : Py_XDECREF(full_name);
30285 0 : Py_XDECREF(module_dot);
30286 0 : Py_XDECREF(module_name);
30287 : }
30288 2 : if (unlikely(!value)) {
30289 0 : PyErr_Format(PyExc_ImportError,
30290 : #if PY_MAJOR_VERSION < 3
30291 : "cannot import name %.230s", PyString_AS_STRING(name));
30292 : #else
30293 : "cannot import name %S", name);
30294 : #endif
30295 : }
30296 2 : return value;
30297 : }
30298 :
30299 : /* HasAttr */
30300 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30301 0 : PyObject *r;
30302 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30303 0 : PyErr_SetString(PyExc_TypeError,
30304 : "hasattr(): attribute name must be string");
30305 0 : return -1;
30306 : }
30307 0 : r = __Pyx_GetAttr(o, n);
30308 0 : if (!r) {
30309 0 : PyErr_Clear();
30310 0 : return 0;
30311 : } else {
30312 0 : Py_DECREF(r);
30313 0 : return 1;
30314 : }
30315 : }
30316 :
30317 : /* decode_c_bytes */
30318 1075 : static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
30319 : const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
30320 : const char* encoding, const char* errors,
30321 : PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
30322 1075 : if (unlikely((start < 0) | (stop < 0))) {
30323 0 : if (start < 0) {
30324 0 : start += length;
30325 0 : if (start < 0)
30326 : start = 0;
30327 : }
30328 0 : if (stop < 0)
30329 0 : stop += length;
30330 : }
30331 1075 : if (stop > length)
30332 : stop = length;
30333 1075 : if (unlikely(stop <= start))
30334 0 : return __Pyx_NewRef(__pyx_empty_unicode);
30335 1075 : length = stop - start;
30336 1075 : cstring += start;
30337 1075 : if (decode_func) {
30338 0 : return decode_func(cstring, length, errors);
30339 : } else {
30340 1075 : return PyUnicode_Decode(cstring, length, encoding, errors);
30341 : }
30342 : }
30343 :
30344 : /* PyObjectFormatAndDecref */
30345 10 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
30346 10 : if (unlikely(!s)) return NULL;
30347 10 : if (likely(PyUnicode_CheckExact(s))) return s;
30348 : #if PY_MAJOR_VERSION < 3
30349 : if (likely(PyString_CheckExact(s))) {
30350 : PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
30351 : Py_DECREF(s);
30352 : return result;
30353 : }
30354 : #endif
30355 0 : return __Pyx_PyObject_FormatAndDecref(s, f);
30356 : }
30357 12 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
30358 12 : PyObject *result;
30359 12 : if (unlikely(!s)) return NULL;
30360 12 : result = PyObject_Format(s, f);
30361 12 : Py_DECREF(s);
30362 : return result;
30363 : }
30364 :
30365 : /* PyIntBinop */
30366 : #if !CYTHON_COMPILING_IN_PYPY
30367 0 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
30368 0 : CYTHON_MAYBE_UNUSED_VAR(intval);
30369 0 : CYTHON_MAYBE_UNUSED_VAR(inplace);
30370 0 : CYTHON_UNUSED_VAR(zerodivision_check);
30371 : #if PY_MAJOR_VERSION < 3
30372 : if (likely(PyInt_CheckExact(op1))) {
30373 : const long b = intval;
30374 : long x;
30375 : long a = PyInt_AS_LONG(op1);
30376 :
30377 : x = (long)((unsigned long)a + (unsigned long)b);
30378 : if (likely((x^a) >= 0 || (x^b) >= 0))
30379 : return PyInt_FromLong(x);
30380 : return PyLong_Type.tp_as_number->nb_add(op1, op2);
30381 : }
30382 : #endif
30383 : #if CYTHON_USE_PYLONG_INTERNALS
30384 0 : if (likely(PyLong_CheckExact(op1))) {
30385 0 : const long b = intval;
30386 0 : long a, x;
30387 : #ifdef HAVE_LONG_LONG
30388 0 : const PY_LONG_LONG llb = intval;
30389 0 : PY_LONG_LONG lla, llx;
30390 : #endif
30391 0 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
30392 0 : return __Pyx_NewRef(op2);
30393 : }
30394 0 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
30395 0 : a = __Pyx_PyLong_CompactValue(op1);
30396 : } else {
30397 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
30398 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
30399 0 : switch (size) {
30400 0 : case -2:
30401 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30402 0 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30403 0 : break;
30404 : #ifdef HAVE_LONG_LONG
30405 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30406 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30407 : goto long_long;
30408 : #endif
30409 : }
30410 0 : CYTHON_FALLTHROUGH;
30411 0 : case 2:
30412 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30413 0 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30414 0 : break;
30415 : #ifdef HAVE_LONG_LONG
30416 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30417 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30418 : goto long_long;
30419 : #endif
30420 : }
30421 : CYTHON_FALLTHROUGH;
30422 : case -3:
30423 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30424 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30425 : break;
30426 : #ifdef HAVE_LONG_LONG
30427 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30428 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30429 : goto long_long;
30430 : #endif
30431 : }
30432 : CYTHON_FALLTHROUGH;
30433 : case 3:
30434 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30435 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30436 : break;
30437 : #ifdef HAVE_LONG_LONG
30438 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30439 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30440 : goto long_long;
30441 : #endif
30442 : }
30443 : CYTHON_FALLTHROUGH;
30444 : case -4:
30445 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30446 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30447 : break;
30448 : #ifdef HAVE_LONG_LONG
30449 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30450 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30451 : goto long_long;
30452 : #endif
30453 : }
30454 : CYTHON_FALLTHROUGH;
30455 : case 4:
30456 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30457 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30458 : break;
30459 : #ifdef HAVE_LONG_LONG
30460 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30461 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30462 : goto long_long;
30463 : #endif
30464 : }
30465 0 : CYTHON_FALLTHROUGH;
30466 0 : default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
30467 : }
30468 : }
30469 0 : x = a + b;
30470 0 : return PyLong_FromLong(x);
30471 : #ifdef HAVE_LONG_LONG
30472 : long_long:
30473 : llx = lla + llb;
30474 : return PyLong_FromLongLong(llx);
30475 : #endif
30476 :
30477 :
30478 : }
30479 : #endif
30480 0 : if (PyFloat_CheckExact(op1)) {
30481 0 : const long b = intval;
30482 : #if CYTHON_COMPILING_IN_LIMITED_API
30483 : double a = __pyx_PyFloat_AsDouble(op1);
30484 : #else
30485 0 : double a = PyFloat_AS_DOUBLE(op1);
30486 : #endif
30487 0 : double result;
30488 :
30489 : PyFPE_START_PROTECT("add", return NULL)
30490 0 : result = ((double)a) + (double)b;
30491 : PyFPE_END_PROTECT(result)
30492 0 : return PyFloat_FromDouble(result);
30493 : }
30494 0 : return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30495 : }
30496 : #endif
30497 :
30498 : /* IterFinish */
30499 0 : static CYTHON_INLINE int __Pyx_IterFinish(void) {
30500 0 : PyObject* exc_type;
30501 0 : __Pyx_PyThreadState_declare
30502 0 : __Pyx_PyThreadState_assign
30503 0 : exc_type = __Pyx_PyErr_CurrentExceptionType();
30504 0 : if (unlikely(exc_type)) {
30505 0 : if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
30506 : return -1;
30507 0 : __Pyx_PyErr_Clear();
30508 0 : return 0;
30509 : }
30510 : return 0;
30511 : }
30512 :
30513 : /* set_iter */
30514 5005 : static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
30515 : Py_ssize_t* p_orig_length, int* p_source_is_set) {
30516 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
30517 5005 : is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
30518 5005 : *p_source_is_set = is_set;
30519 5005 : if (likely(is_set)) {
30520 5005 : *p_orig_length = PySet_Size(iterable);
30521 5005 : Py_INCREF(iterable);
30522 5005 : return iterable;
30523 : }
30524 : #else
30525 : CYTHON_UNUSED_VAR(is_set);
30526 : *p_source_is_set = 0;
30527 : #endif
30528 0 : *p_orig_length = 0;
30529 0 : return PyObject_GetIter(iterable);
30530 : }
30531 50050 : static CYTHON_INLINE int __Pyx_set_iter_next(
30532 : PyObject* iter_obj, Py_ssize_t orig_length,
30533 : Py_ssize_t* ppos, PyObject **value,
30534 : int source_is_set) {
30535 50050 : if (!CYTHON_COMPILING_IN_CPYTHON || PY_VERSION_HEX >= 0x030d0000 || unlikely(!source_is_set)) {
30536 0 : *value = PyIter_Next(iter_obj);
30537 0 : if (unlikely(!*value)) {
30538 0 : return __Pyx_IterFinish();
30539 : }
30540 : CYTHON_UNUSED_VAR(orig_length);
30541 : CYTHON_UNUSED_VAR(ppos);
30542 : return 1;
30543 : }
30544 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
30545 50050 : if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
30546 0 : PyErr_SetString(
30547 : PyExc_RuntimeError,
30548 : "set changed size during iteration");
30549 0 : return -1;
30550 : }
30551 50050 : {
30552 50050 : Py_hash_t hash;
30553 50050 : int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
30554 50050 : assert (ret != -1);
30555 50050 : if (likely(ret)) {
30556 45045 : Py_INCREF(*value);
30557 45045 : return 1;
30558 : }
30559 : }
30560 : #endif
30561 5005 : return 0;
30562 : }
30563 :
30564 : /* UnpackUnboundCMethod */
30565 0 : static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
30566 0 : PyObject *result;
30567 0 : PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
30568 0 : if (unlikely(!selfless_args)) return NULL;
30569 0 : result = PyObject_Call(method, selfless_args, kwargs);
30570 0 : Py_DECREF(selfless_args);
30571 : return result;
30572 : }
30573 : static PyMethodDef __Pyx_UnboundCMethod_Def = {
30574 : "CythonUnboundCMethod",
30575 : __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
30576 : METH_VARARGS | METH_KEYWORDS,
30577 : NULL
30578 : };
30579 1 : static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
30580 1 : PyObject *method;
30581 1 : method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
30582 1 : if (unlikely(!method))
30583 : return -1;
30584 1 : target->method = method;
30585 : #if CYTHON_COMPILING_IN_CPYTHON
30586 : #if PY_MAJOR_VERSION >= 3
30587 1 : if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
30588 : #else
30589 : if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
30590 : #endif
30591 : {
30592 1 : PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
30593 1 : target->func = descr->d_method->ml_meth;
30594 1 : target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
30595 : } else
30596 : #endif
30597 : #if CYTHON_COMPILING_IN_PYPY
30598 : #else
30599 0 : if (PyCFunction_Check(method))
30600 : #endif
30601 : {
30602 0 : PyObject *self;
30603 0 : int self_found;
30604 : #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30605 : self = PyObject_GetAttrString(method, "__self__");
30606 : if (!self) {
30607 : PyErr_Clear();
30608 : }
30609 : #else
30610 0 : self = PyCFunction_GET_SELF(method);
30611 : #endif
30612 0 : self_found = (self && self != Py_None);
30613 : #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30614 : Py_XDECREF(self);
30615 : #endif
30616 0 : if (self_found) {
30617 0 : PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
30618 0 : if (unlikely(!unbound_method)) return -1;
30619 0 : Py_DECREF(method);
30620 0 : target->method = unbound_method;
30621 : }
30622 : }
30623 : return 0;
30624 : }
30625 :
30626 : /* CallUnboundCMethod1 */
30627 : #if CYTHON_COMPILING_IN_CPYTHON
30628 19 : static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
30629 19 : if (likely(cfunc->func)) {
30630 18 : int flag = cfunc->flag;
30631 18 : if (flag == METH_O) {
30632 0 : return (*(cfunc->func))(self, arg);
30633 18 : } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
30634 : #if PY_VERSION_HEX >= 0x030700A0
30635 0 : return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
30636 : #else
30637 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
30638 : #endif
30639 18 : } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
30640 0 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
30641 : }
30642 : }
30643 19 : return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
30644 : }
30645 : #endif
30646 19 : static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
30647 19 : PyObject *args, *result = NULL;
30648 19 : if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
30649 : #if CYTHON_COMPILING_IN_CPYTHON
30650 19 : if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
30651 19 : args = PyTuple_New(1);
30652 19 : if (unlikely(!args)) goto bad;
30653 19 : Py_INCREF(arg);
30654 19 : PyTuple_SET_ITEM(args, 0, arg);
30655 19 : if (cfunc->flag & METH_KEYWORDS)
30656 19 : result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
30657 : else
30658 0 : result = (*cfunc->func)(self, args);
30659 : } else {
30660 0 : args = PyTuple_New(2);
30661 0 : if (unlikely(!args)) goto bad;
30662 0 : Py_INCREF(self);
30663 0 : PyTuple_SET_ITEM(args, 0, self);
30664 0 : Py_INCREF(arg);
30665 0 : PyTuple_SET_ITEM(args, 1, arg);
30666 0 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
30667 : }
30668 : #else
30669 : args = PyTuple_Pack(2, self, arg);
30670 : if (unlikely(!args)) goto bad;
30671 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
30672 : #endif
30673 19 : bad:
30674 19 : Py_XDECREF(args);
30675 19 : return result;
30676 : }
30677 :
30678 : /* CallUnboundCMethod2 */
30679 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
30680 : static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
30681 : if (likely(cfunc->func)) {
30682 : PyObject *args[2] = {arg1, arg2};
30683 : if (cfunc->flag == METH_FASTCALL) {
30684 : #if PY_VERSION_HEX >= 0x030700A0
30685 : return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
30686 : #else
30687 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
30688 : #endif
30689 : }
30690 : #if PY_VERSION_HEX >= 0x030700A0
30691 : if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30692 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
30693 : #endif
30694 : }
30695 : return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
30696 : }
30697 : #endif
30698 : static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
30699 : PyObject *args, *result = NULL;
30700 : if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
30701 : #if CYTHON_COMPILING_IN_CPYTHON
30702 : if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
30703 : args = PyTuple_New(2);
30704 : if (unlikely(!args)) goto bad;
30705 : Py_INCREF(arg1);
30706 : PyTuple_SET_ITEM(args, 0, arg1);
30707 : Py_INCREF(arg2);
30708 : PyTuple_SET_ITEM(args, 1, arg2);
30709 : if (cfunc->flag & METH_KEYWORDS)
30710 : result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
30711 : else
30712 : result = (*cfunc->func)(self, args);
30713 : } else {
30714 : args = PyTuple_New(3);
30715 : if (unlikely(!args)) goto bad;
30716 : Py_INCREF(self);
30717 : PyTuple_SET_ITEM(args, 0, self);
30718 : Py_INCREF(arg1);
30719 : PyTuple_SET_ITEM(args, 1, arg1);
30720 : Py_INCREF(arg2);
30721 : PyTuple_SET_ITEM(args, 2, arg2);
30722 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
30723 : }
30724 : #else
30725 : args = PyTuple_Pack(3, self, arg1, arg2);
30726 : if (unlikely(!args)) goto bad;
30727 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
30728 : #endif
30729 : bad:
30730 : Py_XDECREF(args);
30731 : return result;
30732 : }
30733 :
30734 : /* dict_getitem_default */
30735 45045 : static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
30736 45045 : PyObject* value;
30737 : #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
30738 45045 : value = PyDict_GetItemWithError(d, key);
30739 45045 : if (unlikely(!value)) {
30740 32500 : if (unlikely(PyErr_Occurred()))
30741 : return NULL;
30742 : value = default_value;
30743 : }
30744 45045 : Py_INCREF(value);
30745 : if ((1));
30746 : #else
30747 : if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
30748 : value = PyDict_GetItem(d, key);
30749 : if (unlikely(!value)) {
30750 : value = default_value;
30751 : }
30752 : Py_INCREF(value);
30753 : }
30754 : #endif
30755 : else {
30756 : if (default_value == Py_None)
30757 : value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
30758 : else
30759 : value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
30760 : }
30761 : return value;
30762 : }
30763 :
30764 : /* BufferIndexError */
30765 0 : static void __Pyx_RaiseBufferIndexError(int axis) {
30766 0 : PyErr_Format(PyExc_IndexError,
30767 : "Out of bounds on buffer access (axis %d)", axis);
30768 0 : }
30769 :
30770 : /* PyObject_GenericGetAttrNoDict */
30771 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30772 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30773 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
30774 : PyErr_Format(PyExc_AttributeError,
30775 : #if PY_MAJOR_VERSION >= 3
30776 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
30777 : type_name, attr_name);
30778 : #else
30779 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
30780 : type_name, PyString_AS_STRING(attr_name));
30781 : #endif
30782 : __Pyx_DECREF_TypeName(type_name);
30783 : return NULL;
30784 : }
30785 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30786 : PyObject *descr;
30787 : PyTypeObject *tp = Py_TYPE(obj);
30788 : if (unlikely(!PyString_Check(attr_name))) {
30789 : return PyObject_GenericGetAttr(obj, attr_name);
30790 : }
30791 : assert(!tp->tp_dictoffset);
30792 : descr = _PyType_Lookup(tp, attr_name);
30793 : if (unlikely(!descr)) {
30794 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30795 : }
30796 : Py_INCREF(descr);
30797 : #if PY_MAJOR_VERSION < 3
30798 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30799 : #endif
30800 : {
30801 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30802 : if (unlikely(f)) {
30803 : PyObject *res = f(descr, obj, (PyObject *)tp);
30804 : Py_DECREF(descr);
30805 : return res;
30806 : }
30807 : }
30808 : return descr;
30809 : }
30810 : #endif
30811 :
30812 : /* PyObject_GenericGetAttr */
30813 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30814 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30815 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30816 : return PyObject_GenericGetAttr(obj, attr_name);
30817 : }
30818 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30819 : }
30820 : #endif
30821 :
30822 : /* FixUpExtensionType */
30823 : #if CYTHON_USE_TYPE_SPECS
30824 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
30825 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
30826 : CYTHON_UNUSED_VAR(spec);
30827 : CYTHON_UNUSED_VAR(type);
30828 : #else
30829 : const PyType_Slot *slot = spec->slots;
30830 : while (slot && slot->slot && slot->slot != Py_tp_members)
30831 : slot++;
30832 : if (slot && slot->slot == Py_tp_members) {
30833 : int changed = 0;
30834 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
30835 : const
30836 : #endif
30837 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
30838 : while (memb && memb->name) {
30839 : if (memb->name[0] == '_' && memb->name[1] == '_') {
30840 : #if PY_VERSION_HEX < 0x030900b1
30841 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
30842 : assert(memb->type == T_PYSSIZET);
30843 : assert(memb->flags == READONLY);
30844 : type->tp_weaklistoffset = memb->offset;
30845 : changed = 1;
30846 : }
30847 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
30848 : assert(memb->type == T_PYSSIZET);
30849 : assert(memb->flags == READONLY);
30850 : type->tp_dictoffset = memb->offset;
30851 : changed = 1;
30852 : }
30853 : #if CYTHON_METH_FASTCALL
30854 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
30855 : assert(memb->type == T_PYSSIZET);
30856 : assert(memb->flags == READONLY);
30857 : #if PY_VERSION_HEX >= 0x030800b4
30858 : type->tp_vectorcall_offset = memb->offset;
30859 : #else
30860 : type->tp_print = (printfunc) memb->offset;
30861 : #endif
30862 : changed = 1;
30863 : }
30864 : #endif
30865 : #else
30866 : if ((0));
30867 : #endif
30868 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
30869 : else if (strcmp(memb->name, "__module__") == 0) {
30870 : PyObject *descr;
30871 : assert(memb->type == T_OBJECT);
30872 : assert(memb->flags == 0 || memb->flags == READONLY);
30873 : descr = PyDescr_NewMember(type, memb);
30874 : if (unlikely(!descr))
30875 : return -1;
30876 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
30877 : Py_DECREF(descr);
30878 : return -1;
30879 : }
30880 : Py_DECREF(descr);
30881 : changed = 1;
30882 : }
30883 : #endif
30884 : }
30885 : memb++;
30886 : }
30887 : if (changed)
30888 : PyType_Modified(type);
30889 : }
30890 : #endif
30891 : return 0;
30892 : }
30893 : #endif
30894 :
30895 : /* PyObjectCallNoArg */
30896 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
30897 : PyObject *arg[2] = {NULL, NULL};
30898 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30899 : }
30900 :
30901 : /* PyObjectGetMethod */
30902 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
30903 : PyObject *attr;
30904 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
30905 : __Pyx_TypeName type_name;
30906 : PyTypeObject *tp = Py_TYPE(obj);
30907 : PyObject *descr;
30908 : descrgetfunc f = NULL;
30909 : PyObject **dictptr, *dict;
30910 : int meth_found = 0;
30911 : assert (*method == NULL);
30912 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
30913 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
30914 : goto try_unpack;
30915 : }
30916 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
30917 : return 0;
30918 : }
30919 : descr = _PyType_Lookup(tp, name);
30920 : if (likely(descr != NULL)) {
30921 : Py_INCREF(descr);
30922 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
30923 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
30924 : #elif PY_MAJOR_VERSION >= 3
30925 : #ifdef __Pyx_CyFunction_USED
30926 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
30927 : #else
30928 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
30929 : #endif
30930 : #else
30931 : #ifdef __Pyx_CyFunction_USED
30932 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
30933 : #else
30934 : if (likely(PyFunction_Check(descr)))
30935 : #endif
30936 : #endif
30937 : {
30938 : meth_found = 1;
30939 : } else {
30940 : f = Py_TYPE(descr)->tp_descr_get;
30941 : if (f != NULL && PyDescr_IsData(descr)) {
30942 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
30943 : Py_DECREF(descr);
30944 : goto try_unpack;
30945 : }
30946 : }
30947 : }
30948 : dictptr = _PyObject_GetDictPtr(obj);
30949 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
30950 : Py_INCREF(dict);
30951 : attr = __Pyx_PyDict_GetItemStr(dict, name);
30952 : if (attr != NULL) {
30953 : Py_INCREF(attr);
30954 : Py_DECREF(dict);
30955 : Py_XDECREF(descr);
30956 : goto try_unpack;
30957 : }
30958 : Py_DECREF(dict);
30959 : }
30960 : if (meth_found) {
30961 : *method = descr;
30962 : return 1;
30963 : }
30964 : if (f != NULL) {
30965 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
30966 : Py_DECREF(descr);
30967 : goto try_unpack;
30968 : }
30969 : if (likely(descr != NULL)) {
30970 : *method = descr;
30971 : return 0;
30972 : }
30973 : type_name = __Pyx_PyType_GetName(tp);
30974 : PyErr_Format(PyExc_AttributeError,
30975 : #if PY_MAJOR_VERSION >= 3
30976 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
30977 : type_name, name);
30978 : #else
30979 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
30980 : type_name, PyString_AS_STRING(name));
30981 : #endif
30982 : __Pyx_DECREF_TypeName(type_name);
30983 : return 0;
30984 : #else
30985 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
30986 : goto try_unpack;
30987 : #endif
30988 : try_unpack:
30989 : #if CYTHON_UNPACK_METHODS
30990 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
30991 : PyObject *function = PyMethod_GET_FUNCTION(attr);
30992 : Py_INCREF(function);
30993 : Py_DECREF(attr);
30994 : *method = function;
30995 : return 1;
30996 : }
30997 : #endif
30998 : *method = attr;
30999 : return 0;
31000 : }
31001 :
31002 : /* PyObjectCallMethod0 */
31003 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
31004 : PyObject *method = NULL, *result = NULL;
31005 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
31006 : if (likely(is_method)) {
31007 : result = __Pyx_PyObject_CallOneArg(method, obj);
31008 : Py_DECREF(method);
31009 : return result;
31010 : }
31011 : if (unlikely(!method)) goto bad;
31012 : result = __Pyx_PyObject_CallNoArg(method);
31013 : Py_DECREF(method);
31014 : bad:
31015 : return result;
31016 : }
31017 :
31018 : /* ValidateBasesTuple */
31019 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
31020 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
31021 0 : Py_ssize_t i, n;
31022 : #if CYTHON_ASSUME_SAFE_MACROS
31023 0 : n = PyTuple_GET_SIZE(bases);
31024 : #else
31025 : n = PyTuple_Size(bases);
31026 : if (n < 0) return -1;
31027 : #endif
31028 0 : for (i = 1; i < n; i++)
31029 : {
31030 : #if CYTHON_AVOID_BORROWED_REFS
31031 : PyObject *b0 = PySequence_GetItem(bases, i);
31032 : if (!b0) return -1;
31033 : #elif CYTHON_ASSUME_SAFE_MACROS
31034 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
31035 : #else
31036 : PyObject *b0 = PyTuple_GetItem(bases, i);
31037 : if (!b0) return -1;
31038 : #endif
31039 0 : PyTypeObject *b;
31040 : #if PY_MAJOR_VERSION < 3
31041 : if (PyClass_Check(b0))
31042 : {
31043 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
31044 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
31045 : #if CYTHON_AVOID_BORROWED_REFS
31046 : Py_DECREF(b0);
31047 : #endif
31048 : return -1;
31049 : }
31050 : #endif
31051 0 : b = (PyTypeObject*) b0;
31052 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
31053 : {
31054 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31055 0 : PyErr_Format(PyExc_TypeError,
31056 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
31057 0 : __Pyx_DECREF_TypeName(b_name);
31058 : #if CYTHON_AVOID_BORROWED_REFS
31059 : Py_DECREF(b0);
31060 : #endif
31061 0 : return -1;
31062 : }
31063 0 : if (dictoffset == 0)
31064 : {
31065 0 : Py_ssize_t b_dictoffset = 0;
31066 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
31067 0 : b_dictoffset = b->tp_dictoffset;
31068 : #else
31069 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
31070 : if (!py_b_dictoffset) goto dictoffset_return;
31071 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
31072 : Py_DECREF(py_b_dictoffset);
31073 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
31074 : #endif
31075 0 : if (b_dictoffset) {
31076 0 : {
31077 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31078 0 : PyErr_Format(PyExc_TypeError,
31079 : "extension type '%.200s' has no __dict__ slot, "
31080 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
31081 : "either add 'cdef dict __dict__' to the extension type "
31082 : "or add '__slots__ = [...]' to the base type",
31083 : type_name, b_name);
31084 0 : __Pyx_DECREF_TypeName(b_name);
31085 : }
31086 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
31087 : dictoffset_return:
31088 : #endif
31089 : #if CYTHON_AVOID_BORROWED_REFS
31090 : Py_DECREF(b0);
31091 : #endif
31092 0 : return -1;
31093 : }
31094 : }
31095 : #if CYTHON_AVOID_BORROWED_REFS
31096 : Py_DECREF(b0);
31097 : #endif
31098 : }
31099 : return 0;
31100 : }
31101 : #endif
31102 :
31103 : /* PyType_Ready */
31104 4 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
31105 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
31106 : (void)__Pyx_PyObject_CallMethod0;
31107 : #if CYTHON_USE_TYPE_SPECS
31108 : (void)__Pyx_validate_bases_tuple;
31109 : #endif
31110 : return PyType_Ready(t);
31111 : #else
31112 4 : int r;
31113 4 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
31114 4 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
31115 : return -1;
31116 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31117 4 : {
31118 4 : int gc_was_enabled;
31119 : #if PY_VERSION_HEX >= 0x030A00b1
31120 4 : gc_was_enabled = PyGC_Disable();
31121 4 : (void)__Pyx_PyObject_CallMethod0;
31122 : #else
31123 : PyObject *ret, *py_status;
31124 : PyObject *gc = NULL;
31125 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
31126 : gc = PyImport_GetModule(__pyx_kp_u_gc);
31127 : #endif
31128 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
31129 : if (unlikely(!gc)) return -1;
31130 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
31131 : if (unlikely(!py_status)) {
31132 : Py_DECREF(gc);
31133 : return -1;
31134 : }
31135 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
31136 : Py_DECREF(py_status);
31137 : if (gc_was_enabled > 0) {
31138 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
31139 : if (unlikely(!ret)) {
31140 : Py_DECREF(gc);
31141 : return -1;
31142 : }
31143 : Py_DECREF(ret);
31144 : } else if (unlikely(gc_was_enabled == -1)) {
31145 : Py_DECREF(gc);
31146 : return -1;
31147 : }
31148 : #endif
31149 4 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
31150 : #if PY_VERSION_HEX >= 0x030A0000
31151 4 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
31152 : #endif
31153 : #else
31154 : (void)__Pyx_PyObject_CallMethod0;
31155 : #endif
31156 4 : r = PyType_Ready(t);
31157 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31158 4 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
31159 : #if PY_VERSION_HEX >= 0x030A00b1
31160 4 : if (gc_was_enabled)
31161 4 : PyGC_Enable();
31162 : #else
31163 : if (gc_was_enabled) {
31164 : PyObject *tp, *v, *tb;
31165 : PyErr_Fetch(&tp, &v, &tb);
31166 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
31167 : if (likely(ret || r == -1)) {
31168 : Py_XDECREF(ret);
31169 : PyErr_Restore(tp, v, tb);
31170 : } else {
31171 : Py_XDECREF(tp);
31172 : Py_XDECREF(v);
31173 : Py_XDECREF(tb);
31174 : r = -1;
31175 : }
31176 : }
31177 : Py_DECREF(gc);
31178 : #endif
31179 : }
31180 : #endif
31181 : return r;
31182 : #endif
31183 : }
31184 :
31185 : /* SetVTable */
31186 3 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
31187 3 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
31188 3 : if (unlikely(!ob))
31189 0 : goto bad;
31190 : #if CYTHON_COMPILING_IN_LIMITED_API
31191 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
31192 : #else
31193 3 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
31194 : #endif
31195 0 : goto bad;
31196 3 : Py_DECREF(ob);
31197 : return 0;
31198 0 : bad:
31199 0 : Py_XDECREF(ob);
31200 0 : return -1;
31201 : }
31202 :
31203 : /* GetVTable */
31204 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
31205 0 : void* ptr;
31206 : #if CYTHON_COMPILING_IN_LIMITED_API
31207 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
31208 : #else
31209 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
31210 : #endif
31211 0 : if (!ob)
31212 0 : goto bad;
31213 0 : ptr = PyCapsule_GetPointer(ob, 0);
31214 0 : if (!ptr && !PyErr_Occurred())
31215 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
31216 0 : Py_DECREF(ob);
31217 : return ptr;
31218 0 : bad:
31219 0 : Py_XDECREF(ob);
31220 0 : return NULL;
31221 : }
31222 :
31223 : /* MergeVTables */
31224 : #if !CYTHON_COMPILING_IN_LIMITED_API
31225 3 : static int __Pyx_MergeVtables(PyTypeObject *type) {
31226 3 : int i;
31227 3 : void** base_vtables;
31228 3 : __Pyx_TypeName tp_base_name;
31229 3 : __Pyx_TypeName base_name;
31230 3 : void* unknown = (void*)-1;
31231 3 : PyObject* bases = type->tp_bases;
31232 3 : int base_depth = 0;
31233 3 : {
31234 3 : PyTypeObject* base = type->tp_base;
31235 7 : while (base) {
31236 4 : base_depth += 1;
31237 4 : base = base->tp_base;
31238 : }
31239 : }
31240 3 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
31241 3 : base_vtables[0] = unknown;
31242 3 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
31243 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
31244 0 : if (base_vtable != NULL) {
31245 0 : int j;
31246 0 : PyTypeObject* base = type->tp_base;
31247 0 : for (j = 0; j < base_depth; j++) {
31248 0 : if (base_vtables[j] == unknown) {
31249 0 : base_vtables[j] = __Pyx_GetVtable(base);
31250 0 : base_vtables[j + 1] = unknown;
31251 : }
31252 0 : if (base_vtables[j] == base_vtable) {
31253 : break;
31254 0 : } else if (base_vtables[j] == NULL) {
31255 0 : goto bad;
31256 : }
31257 0 : base = base->tp_base;
31258 : }
31259 : }
31260 : }
31261 3 : PyErr_Clear();
31262 3 : free(base_vtables);
31263 3 : return 0;
31264 0 : bad:
31265 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
31266 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
31267 0 : PyErr_Format(PyExc_TypeError,
31268 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
31269 0 : __Pyx_DECREF_TypeName(tp_base_name);
31270 0 : __Pyx_DECREF_TypeName(base_name);
31271 0 : free(base_vtables);
31272 0 : return -1;
31273 : }
31274 : #endif
31275 :
31276 : /* SetupReduce */
31277 : #if !CYTHON_COMPILING_IN_LIMITED_API
31278 2 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
31279 2 : int ret;
31280 2 : PyObject *name_attr;
31281 2 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
31282 2 : if (likely(name_attr)) {
31283 2 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
31284 : } else {
31285 : ret = -1;
31286 : }
31287 2 : if (unlikely(ret < 0)) {
31288 0 : PyErr_Clear();
31289 0 : ret = 0;
31290 : }
31291 2 : Py_XDECREF(name_attr);
31292 2 : return ret;
31293 : }
31294 4 : static int __Pyx_setup_reduce(PyObject* type_obj) {
31295 4 : int ret = 0;
31296 4 : PyObject *object_reduce = NULL;
31297 4 : PyObject *object_getstate = NULL;
31298 4 : PyObject *object_reduce_ex = NULL;
31299 4 : PyObject *reduce = NULL;
31300 4 : PyObject *reduce_ex = NULL;
31301 4 : PyObject *reduce_cython = NULL;
31302 4 : PyObject *setstate = NULL;
31303 4 : PyObject *setstate_cython = NULL;
31304 4 : PyObject *getstate = NULL;
31305 : #if CYTHON_USE_PYTYPE_LOOKUP
31306 4 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
31307 : #else
31308 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
31309 : if (!getstate && PyErr_Occurred()) {
31310 : goto __PYX_BAD;
31311 : }
31312 : #endif
31313 4 : if (getstate) {
31314 : #if CYTHON_USE_PYTYPE_LOOKUP
31315 4 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
31316 : #else
31317 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
31318 : if (!object_getstate && PyErr_Occurred()) {
31319 : goto __PYX_BAD;
31320 : }
31321 : #endif
31322 4 : if (object_getstate != getstate) {
31323 0 : goto __PYX_GOOD;
31324 : }
31325 : }
31326 : #if CYTHON_USE_PYTYPE_LOOKUP
31327 4 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31328 : #else
31329 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31330 : #endif
31331 4 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
31332 4 : if (reduce_ex == object_reduce_ex) {
31333 : #if CYTHON_USE_PYTYPE_LOOKUP
31334 4 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31335 : #else
31336 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31337 : #endif
31338 4 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
31339 4 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
31340 4 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
31341 4 : if (likely(reduce_cython)) {
31342 4 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31343 4 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31344 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
31345 0 : goto __PYX_BAD;
31346 : }
31347 4 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
31348 4 : if (!setstate) PyErr_Clear();
31349 4 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
31350 4 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
31351 4 : if (likely(setstate_cython)) {
31352 4 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31353 4 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31354 0 : } else if (!setstate || PyErr_Occurred()) {
31355 0 : goto __PYX_BAD;
31356 : }
31357 : }
31358 4 : PyType_Modified((PyTypeObject*)type_obj);
31359 : }
31360 : }
31361 4 : goto __PYX_GOOD;
31362 0 : __PYX_BAD:
31363 0 : if (!PyErr_Occurred()) {
31364 0 : __Pyx_TypeName type_obj_name =
31365 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
31366 0 : PyErr_Format(PyExc_RuntimeError,
31367 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
31368 0 : __Pyx_DECREF_TypeName(type_obj_name);
31369 : }
31370 : ret = -1;
31371 4 : __PYX_GOOD:
31372 : #if !CYTHON_USE_PYTYPE_LOOKUP
31373 : Py_XDECREF(object_reduce);
31374 : Py_XDECREF(object_reduce_ex);
31375 : Py_XDECREF(object_getstate);
31376 : Py_XDECREF(getstate);
31377 : #endif
31378 4 : Py_XDECREF(reduce);
31379 4 : Py_XDECREF(reduce_ex);
31380 4 : Py_XDECREF(reduce_cython);
31381 4 : Py_XDECREF(setstate);
31382 4 : Py_XDECREF(setstate_cython);
31383 4 : return ret;
31384 : }
31385 : #endif
31386 :
31387 : /* TypeImport */
31388 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
31389 : #define __PYX_HAVE_RT_ImportType_3_0_11
31390 16 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
31391 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
31392 : {
31393 16 : PyObject *result = 0;
31394 16 : char warning[200];
31395 16 : Py_ssize_t basicsize;
31396 16 : Py_ssize_t itemsize;
31397 : #if CYTHON_COMPILING_IN_LIMITED_API
31398 : PyObject *py_basicsize;
31399 : PyObject *py_itemsize;
31400 : #endif
31401 16 : result = PyObject_GetAttrString(module, class_name);
31402 16 : if (!result)
31403 0 : goto bad;
31404 16 : if (!PyType_Check(result)) {
31405 0 : PyErr_Format(PyExc_TypeError,
31406 : "%.200s.%.200s is not a type object",
31407 : module_name, class_name);
31408 0 : goto bad;
31409 : }
31410 : #if !CYTHON_COMPILING_IN_LIMITED_API
31411 16 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
31412 16 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
31413 : #else
31414 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
31415 : if (!py_basicsize)
31416 : goto bad;
31417 : basicsize = PyLong_AsSsize_t(py_basicsize);
31418 : Py_DECREF(py_basicsize);
31419 : py_basicsize = 0;
31420 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
31421 : goto bad;
31422 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
31423 : if (!py_itemsize)
31424 : goto bad;
31425 : itemsize = PyLong_AsSsize_t(py_itemsize);
31426 : Py_DECREF(py_itemsize);
31427 : py_itemsize = 0;
31428 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
31429 : goto bad;
31430 : #endif
31431 16 : if (itemsize) {
31432 1 : if (size % alignment) {
31433 0 : alignment = size % alignment;
31434 : }
31435 1 : if (itemsize < (Py_ssize_t)alignment)
31436 : itemsize = (Py_ssize_t)alignment;
31437 : }
31438 16 : if ((size_t)(basicsize + itemsize) < size) {
31439 0 : PyErr_Format(PyExc_ValueError,
31440 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
31441 : "Expected %zd from C header, got %zd from PyObject",
31442 : module_name, class_name, size, basicsize+itemsize);
31443 0 : goto bad;
31444 : }
31445 16 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
31446 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
31447 0 : PyErr_Format(PyExc_ValueError,
31448 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
31449 : "Expected %zd from C header, got %zd-%zd from PyObject",
31450 : module_name, class_name, size, basicsize, basicsize+itemsize);
31451 0 : goto bad;
31452 : }
31453 16 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
31454 0 : PyOS_snprintf(warning, sizeof(warning),
31455 : "%s.%s size changed, may indicate binary incompatibility. "
31456 : "Expected %zd from C header, got %zd from PyObject",
31457 : module_name, class_name, size, basicsize);
31458 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
31459 : }
31460 : return (PyTypeObject *)result;
31461 0 : bad:
31462 0 : Py_XDECREF(result);
31463 : return NULL;
31464 : }
31465 : #endif
31466 :
31467 : /* FetchSharedCythonModule */
31468 1 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
31469 1 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
31470 : }
31471 :
31472 : /* FetchCommonType */
31473 1 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
31474 : const char *name,
31475 : Py_ssize_t basicsize,
31476 : Py_ssize_t expected_basicsize) {
31477 1 : if (!PyType_Check(cached_type)) {
31478 0 : PyErr_Format(PyExc_TypeError,
31479 : "Shared Cython type %.200s is not a type object", name);
31480 0 : return -1;
31481 : }
31482 1 : if (basicsize != expected_basicsize) {
31483 0 : PyErr_Format(PyExc_TypeError,
31484 : "Shared Cython type %.200s has the wrong size, try recompiling",
31485 : name);
31486 0 : return -1;
31487 : }
31488 : return 0;
31489 : }
31490 : #if !CYTHON_USE_TYPE_SPECS
31491 1 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
31492 1 : PyObject* abi_module;
31493 1 : const char* object_name;
31494 1 : PyTypeObject *cached_type = NULL;
31495 1 : abi_module = __Pyx_FetchSharedCythonABIModule();
31496 1 : if (!abi_module) return NULL;
31497 1 : object_name = strrchr(type->tp_name, '.');
31498 1 : object_name = object_name ? object_name+1 : type->tp_name;
31499 1 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
31500 1 : if (cached_type) {
31501 1 : if (__Pyx_VerifyCachedType(
31502 : (PyObject *)cached_type,
31503 : object_name,
31504 : cached_type->tp_basicsize,
31505 : type->tp_basicsize) < 0) {
31506 0 : goto bad;
31507 : }
31508 1 : goto done;
31509 : }
31510 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
31511 0 : PyErr_Clear();
31512 0 : if (PyType_Ready(type) < 0) goto bad;
31513 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
31514 0 : goto bad;
31515 0 : Py_INCREF(type);
31516 : cached_type = type;
31517 1 : done:
31518 1 : Py_DECREF(abi_module);
31519 : return cached_type;
31520 0 : bad:
31521 0 : Py_XDECREF(cached_type);
31522 0 : cached_type = NULL;
31523 0 : goto done;
31524 : }
31525 : #else
31526 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
31527 : PyObject *abi_module, *cached_type = NULL;
31528 : const char* object_name = strrchr(spec->name, '.');
31529 : object_name = object_name ? object_name+1 : spec->name;
31530 : abi_module = __Pyx_FetchSharedCythonABIModule();
31531 : if (!abi_module) return NULL;
31532 : cached_type = PyObject_GetAttrString(abi_module, object_name);
31533 : if (cached_type) {
31534 : Py_ssize_t basicsize;
31535 : #if CYTHON_COMPILING_IN_LIMITED_API
31536 : PyObject *py_basicsize;
31537 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
31538 : if (unlikely(!py_basicsize)) goto bad;
31539 : basicsize = PyLong_AsSsize_t(py_basicsize);
31540 : Py_DECREF(py_basicsize);
31541 : py_basicsize = 0;
31542 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
31543 : #else
31544 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
31545 : #endif
31546 : if (__Pyx_VerifyCachedType(
31547 : cached_type,
31548 : object_name,
31549 : basicsize,
31550 : spec->basicsize) < 0) {
31551 : goto bad;
31552 : }
31553 : goto done;
31554 : }
31555 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
31556 : PyErr_Clear();
31557 : CYTHON_UNUSED_VAR(module);
31558 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
31559 : if (unlikely(!cached_type)) goto bad;
31560 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
31561 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
31562 : done:
31563 : Py_DECREF(abi_module);
31564 : assert(cached_type == NULL || PyType_Check(cached_type));
31565 : return (PyTypeObject *) cached_type;
31566 : bad:
31567 : Py_XDECREF(cached_type);
31568 : cached_type = NULL;
31569 : goto done;
31570 : }
31571 : #endif
31572 :
31573 : /* PyVectorcallFastCallDict */
31574 : #if CYTHON_METH_FASTCALL
31575 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
31576 : {
31577 0 : PyObject *res = NULL;
31578 0 : PyObject *kwnames;
31579 0 : PyObject **newargs;
31580 0 : PyObject **kwvalues;
31581 0 : Py_ssize_t i, pos;
31582 0 : size_t j;
31583 0 : PyObject *key, *value;
31584 0 : unsigned long keys_are_strings;
31585 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
31586 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
31587 0 : if (unlikely(newargs == NULL)) {
31588 0 : PyErr_NoMemory();
31589 0 : return NULL;
31590 : }
31591 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
31592 0 : kwnames = PyTuple_New(nkw);
31593 0 : if (unlikely(kwnames == NULL)) {
31594 0 : PyMem_Free(newargs);
31595 0 : return NULL;
31596 : }
31597 0 : kwvalues = newargs + nargs;
31598 0 : pos = i = 0;
31599 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
31600 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
31601 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
31602 0 : Py_INCREF(key);
31603 0 : Py_INCREF(value);
31604 0 : PyTuple_SET_ITEM(kwnames, i, key);
31605 0 : kwvalues[i] = value;
31606 0 : i++;
31607 : }
31608 0 : if (unlikely(!keys_are_strings)) {
31609 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
31610 0 : goto cleanup;
31611 : }
31612 0 : res = vc(func, newargs, nargs, kwnames);
31613 0 : cleanup:
31614 0 : Py_DECREF(kwnames);
31615 0 : for (i = 0; i < nkw; i++)
31616 0 : Py_DECREF(kwvalues[i]);
31617 0 : PyMem_Free(newargs);
31618 : return res;
31619 : }
31620 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
31621 : {
31622 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
31623 0 : return vc(func, args, nargs, NULL);
31624 : }
31625 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
31626 : }
31627 : #endif
31628 :
31629 : /* CythonFunctionShared */
31630 : #if CYTHON_COMPILING_IN_LIMITED_API
31631 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
31632 : if (__Pyx_CyFunction_Check(func)) {
31633 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
31634 : } else if (PyCFunction_Check(func)) {
31635 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
31636 : }
31637 : return 0;
31638 : }
31639 : #else
31640 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
31641 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
31642 : }
31643 : #endif
31644 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
31645 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
31646 : __Pyx_Py_XDECREF_SET(
31647 : __Pyx_CyFunction_GetClassObj(f),
31648 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
31649 : #else
31650 : __Pyx_Py_XDECREF_SET(
31651 : ((PyCMethodObject *) (f))->mm_class,
31652 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
31653 : #endif
31654 : }
31655 : static PyObject *
31656 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
31657 : {
31658 0 : CYTHON_UNUSED_VAR(closure);
31659 0 : if (unlikely(op->func_doc == NULL)) {
31660 : #if CYTHON_COMPILING_IN_LIMITED_API
31661 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
31662 : if (unlikely(!op->func_doc)) return NULL;
31663 : #else
31664 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
31665 : #if PY_MAJOR_VERSION >= 3
31666 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
31667 : #else
31668 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
31669 : #endif
31670 0 : if (unlikely(op->func_doc == NULL))
31671 : return NULL;
31672 : } else {
31673 0 : Py_INCREF(Py_None);
31674 0 : return Py_None;
31675 : }
31676 : #endif
31677 : }
31678 0 : Py_INCREF(op->func_doc);
31679 : return op->func_doc;
31680 : }
31681 : static int
31682 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
31683 : {
31684 0 : CYTHON_UNUSED_VAR(context);
31685 0 : if (value == NULL) {
31686 0 : value = Py_None;
31687 : }
31688 0 : Py_INCREF(value);
31689 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
31690 0 : return 0;
31691 : }
31692 : static PyObject *
31693 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
31694 : {
31695 0 : CYTHON_UNUSED_VAR(context);
31696 0 : if (unlikely(op->func_name == NULL)) {
31697 : #if CYTHON_COMPILING_IN_LIMITED_API
31698 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
31699 : #elif PY_MAJOR_VERSION >= 3
31700 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
31701 : #else
31702 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
31703 : #endif
31704 0 : if (unlikely(op->func_name == NULL))
31705 : return NULL;
31706 : }
31707 0 : Py_INCREF(op->func_name);
31708 : return op->func_name;
31709 : }
31710 : static int
31711 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
31712 : {
31713 0 : CYTHON_UNUSED_VAR(context);
31714 : #if PY_MAJOR_VERSION >= 3
31715 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
31716 : #else
31717 : if (unlikely(value == NULL || !PyString_Check(value)))
31718 : #endif
31719 : {
31720 0 : PyErr_SetString(PyExc_TypeError,
31721 : "__name__ must be set to a string object");
31722 0 : return -1;
31723 : }
31724 0 : Py_INCREF(value);
31725 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
31726 0 : return 0;
31727 : }
31728 : static PyObject *
31729 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
31730 : {
31731 0 : CYTHON_UNUSED_VAR(context);
31732 0 : Py_INCREF(op->func_qualname);
31733 0 : return op->func_qualname;
31734 : }
31735 : static int
31736 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
31737 : {
31738 0 : CYTHON_UNUSED_VAR(context);
31739 : #if PY_MAJOR_VERSION >= 3
31740 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
31741 : #else
31742 : if (unlikely(value == NULL || !PyString_Check(value)))
31743 : #endif
31744 : {
31745 0 : PyErr_SetString(PyExc_TypeError,
31746 : "__qualname__ must be set to a string object");
31747 0 : return -1;
31748 : }
31749 0 : Py_INCREF(value);
31750 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
31751 0 : return 0;
31752 : }
31753 : static PyObject *
31754 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
31755 : {
31756 0 : CYTHON_UNUSED_VAR(context);
31757 0 : if (unlikely(op->func_dict == NULL)) {
31758 0 : op->func_dict = PyDict_New();
31759 0 : if (unlikely(op->func_dict == NULL))
31760 : return NULL;
31761 : }
31762 0 : Py_INCREF(op->func_dict);
31763 : return op->func_dict;
31764 : }
31765 : static int
31766 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
31767 : {
31768 0 : CYTHON_UNUSED_VAR(context);
31769 0 : if (unlikely(value == NULL)) {
31770 0 : PyErr_SetString(PyExc_TypeError,
31771 : "function's dictionary may not be deleted");
31772 0 : return -1;
31773 : }
31774 0 : if (unlikely(!PyDict_Check(value))) {
31775 0 : PyErr_SetString(PyExc_TypeError,
31776 : "setting function's dictionary to a non-dict");
31777 0 : return -1;
31778 : }
31779 0 : Py_INCREF(value);
31780 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
31781 0 : return 0;
31782 : }
31783 : static PyObject *
31784 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
31785 : {
31786 0 : CYTHON_UNUSED_VAR(context);
31787 0 : Py_INCREF(op->func_globals);
31788 0 : return op->func_globals;
31789 : }
31790 : static PyObject *
31791 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
31792 : {
31793 0 : CYTHON_UNUSED_VAR(op);
31794 0 : CYTHON_UNUSED_VAR(context);
31795 0 : Py_INCREF(Py_None);
31796 0 : return Py_None;
31797 : }
31798 : static PyObject *
31799 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
31800 : {
31801 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
31802 0 : CYTHON_UNUSED_VAR(context);
31803 0 : Py_INCREF(result);
31804 0 : return result;
31805 : }
31806 : static int
31807 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
31808 0 : int result = 0;
31809 0 : PyObject *res = op->defaults_getter((PyObject *) op);
31810 0 : if (unlikely(!res))
31811 : return -1;
31812 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31813 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
31814 0 : Py_INCREF(op->defaults_tuple);
31815 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
31816 0 : Py_INCREF(op->defaults_kwdict);
31817 : #else
31818 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
31819 : if (unlikely(!op->defaults_tuple)) result = -1;
31820 : else {
31821 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
31822 : if (unlikely(!op->defaults_kwdict)) result = -1;
31823 : }
31824 : #endif
31825 0 : Py_DECREF(res);
31826 : return result;
31827 : }
31828 : static int
31829 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
31830 0 : CYTHON_UNUSED_VAR(context);
31831 0 : if (!value) {
31832 : value = Py_None;
31833 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
31834 0 : PyErr_SetString(PyExc_TypeError,
31835 : "__defaults__ must be set to a tuple object");
31836 0 : return -1;
31837 : }
31838 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
31839 : "currently affect the values used in function calls", 1);
31840 0 : Py_INCREF(value);
31841 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
31842 0 : return 0;
31843 : }
31844 : static PyObject *
31845 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
31846 0 : PyObject* result = op->defaults_tuple;
31847 0 : CYTHON_UNUSED_VAR(context);
31848 0 : if (unlikely(!result)) {
31849 0 : if (op->defaults_getter) {
31850 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
31851 0 : result = op->defaults_tuple;
31852 : } else {
31853 : result = Py_None;
31854 : }
31855 : }
31856 0 : Py_INCREF(result);
31857 : return result;
31858 : }
31859 : static int
31860 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
31861 0 : CYTHON_UNUSED_VAR(context);
31862 0 : if (!value) {
31863 : value = Py_None;
31864 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
31865 0 : PyErr_SetString(PyExc_TypeError,
31866 : "__kwdefaults__ must be set to a dict object");
31867 0 : return -1;
31868 : }
31869 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
31870 : "currently affect the values used in function calls", 1);
31871 0 : Py_INCREF(value);
31872 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
31873 0 : return 0;
31874 : }
31875 : static PyObject *
31876 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
31877 0 : PyObject* result = op->defaults_kwdict;
31878 0 : CYTHON_UNUSED_VAR(context);
31879 0 : if (unlikely(!result)) {
31880 0 : if (op->defaults_getter) {
31881 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
31882 0 : result = op->defaults_kwdict;
31883 : } else {
31884 : result = Py_None;
31885 : }
31886 : }
31887 0 : Py_INCREF(result);
31888 : return result;
31889 : }
31890 : static int
31891 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
31892 0 : CYTHON_UNUSED_VAR(context);
31893 0 : if (!value || value == Py_None) {
31894 : value = NULL;
31895 0 : } else if (unlikely(!PyDict_Check(value))) {
31896 0 : PyErr_SetString(PyExc_TypeError,
31897 : "__annotations__ must be set to a dict object");
31898 0 : return -1;
31899 : }
31900 0 : Py_XINCREF(value);
31901 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
31902 0 : return 0;
31903 : }
31904 : static PyObject *
31905 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
31906 0 : PyObject* result = op->func_annotations;
31907 0 : CYTHON_UNUSED_VAR(context);
31908 0 : if (unlikely(!result)) {
31909 0 : result = PyDict_New();
31910 0 : if (unlikely(!result)) return NULL;
31911 0 : op->func_annotations = result;
31912 : }
31913 0 : Py_INCREF(result);
31914 : return result;
31915 : }
31916 : static PyObject *
31917 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
31918 0 : int is_coroutine;
31919 0 : CYTHON_UNUSED_VAR(context);
31920 0 : if (op->func_is_coroutine) {
31921 0 : return __Pyx_NewRef(op->func_is_coroutine);
31922 : }
31923 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
31924 : #if PY_VERSION_HEX >= 0x03050000
31925 0 : if (is_coroutine) {
31926 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
31927 0 : fromlist = PyList_New(1);
31928 0 : if (unlikely(!fromlist)) return NULL;
31929 0 : Py_INCREF(marker);
31930 : #if CYTHON_ASSUME_SAFE_MACROS
31931 0 : PyList_SET_ITEM(fromlist, 0, marker);
31932 : #else
31933 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
31934 : Py_DECREF(marker);
31935 : Py_DECREF(fromlist);
31936 : return NULL;
31937 : }
31938 : #endif
31939 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
31940 0 : Py_DECREF(fromlist);
31941 0 : if (unlikely(!module)) goto ignore;
31942 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
31943 0 : Py_DECREF(module);
31944 0 : if (likely(op->func_is_coroutine)) {
31945 0 : return __Pyx_NewRef(op->func_is_coroutine);
31946 : }
31947 0 : ignore:
31948 0 : PyErr_Clear();
31949 : }
31950 : #endif
31951 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
31952 0 : return __Pyx_NewRef(op->func_is_coroutine);
31953 : }
31954 : #if CYTHON_COMPILING_IN_LIMITED_API
31955 : static PyObject *
31956 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
31957 : CYTHON_UNUSED_VAR(context);
31958 : return PyObject_GetAttrString(op->func, "__module__");
31959 : }
31960 : static int
31961 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
31962 : CYTHON_UNUSED_VAR(context);
31963 : return PyObject_SetAttrString(op->func, "__module__", value);
31964 : }
31965 : #endif
31966 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
31967 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
31968 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
31969 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
31970 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
31971 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
31972 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
31973 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
31974 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
31975 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
31976 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
31977 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
31978 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31979 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31980 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31981 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31982 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
31983 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
31984 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
31985 : #if CYTHON_COMPILING_IN_LIMITED_API
31986 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
31987 : #endif
31988 : {0, 0, 0, 0, 0}
31989 : };
31990 : static PyMemberDef __pyx_CyFunction_members[] = {
31991 : #if !CYTHON_COMPILING_IN_LIMITED_API
31992 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
31993 : #endif
31994 : #if CYTHON_USE_TYPE_SPECS
31995 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
31996 : #if CYTHON_METH_FASTCALL
31997 : #if CYTHON_BACKPORT_VECTORCALL
31998 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
31999 : #else
32000 : #if !CYTHON_COMPILING_IN_LIMITED_API
32001 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
32002 : #endif
32003 : #endif
32004 : #endif
32005 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32006 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
32007 : #else
32008 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
32009 : #endif
32010 : #endif
32011 : {0, 0, 0, 0, 0}
32012 : };
32013 : static PyObject *
32014 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
32015 : {
32016 0 : CYTHON_UNUSED_VAR(args);
32017 : #if PY_MAJOR_VERSION >= 3
32018 0 : Py_INCREF(m->func_qualname);
32019 0 : return m->func_qualname;
32020 : #else
32021 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
32022 : #endif
32023 : }
32024 : static PyMethodDef __pyx_CyFunction_methods[] = {
32025 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
32026 : {0, 0, 0, 0}
32027 : };
32028 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32029 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
32030 : #else
32031 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
32032 : #endif
32033 1 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
32034 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32035 : #if !CYTHON_COMPILING_IN_LIMITED_API
32036 1 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
32037 : #endif
32038 1 : if (unlikely(op == NULL))
32039 : return NULL;
32040 : #if CYTHON_COMPILING_IN_LIMITED_API
32041 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
32042 : if (unlikely(!op->func)) return NULL;
32043 : #endif
32044 1 : op->flags = flags;
32045 1 : __Pyx_CyFunction_weakreflist(op) = NULL;
32046 : #if !CYTHON_COMPILING_IN_LIMITED_API
32047 1 : cf->m_ml = ml;
32048 1 : cf->m_self = (PyObject *) op;
32049 : #endif
32050 1 : Py_XINCREF(closure);
32051 1 : op->func_closure = closure;
32052 : #if !CYTHON_COMPILING_IN_LIMITED_API
32053 1 : Py_XINCREF(module);
32054 1 : cf->m_module = module;
32055 : #endif
32056 1 : op->func_dict = NULL;
32057 1 : op->func_name = NULL;
32058 1 : Py_INCREF(qualname);
32059 1 : op->func_qualname = qualname;
32060 1 : op->func_doc = NULL;
32061 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
32062 : op->func_classobj = NULL;
32063 : #else
32064 1 : ((PyCMethodObject*)op)->mm_class = NULL;
32065 : #endif
32066 1 : op->func_globals = globals;
32067 1 : Py_INCREF(op->func_globals);
32068 1 : Py_XINCREF(code);
32069 1 : op->func_code = code;
32070 1 : op->defaults_pyobjects = 0;
32071 1 : op->defaults_size = 0;
32072 1 : op->defaults = NULL;
32073 1 : op->defaults_tuple = NULL;
32074 1 : op->defaults_kwdict = NULL;
32075 1 : op->defaults_getter = NULL;
32076 1 : op->func_annotations = NULL;
32077 1 : op->func_is_coroutine = NULL;
32078 : #if CYTHON_METH_FASTCALL
32079 1 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
32080 0 : case METH_NOARGS:
32081 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
32082 0 : break;
32083 0 : case METH_O:
32084 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
32085 0 : break;
32086 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
32087 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
32088 0 : break;
32089 1 : case METH_FASTCALL | METH_KEYWORDS:
32090 1 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
32091 1 : break;
32092 0 : case METH_VARARGS | METH_KEYWORDS:
32093 0 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
32094 0 : break;
32095 0 : default:
32096 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32097 0 : Py_DECREF(op);
32098 : return NULL;
32099 : }
32100 : #endif
32101 : return (PyObject *) op;
32102 : }
32103 : static int
32104 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
32105 : {
32106 0 : Py_CLEAR(m->func_closure);
32107 : #if CYTHON_COMPILING_IN_LIMITED_API
32108 : Py_CLEAR(m->func);
32109 : #else
32110 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
32111 : #endif
32112 0 : Py_CLEAR(m->func_dict);
32113 0 : Py_CLEAR(m->func_name);
32114 0 : Py_CLEAR(m->func_qualname);
32115 0 : Py_CLEAR(m->func_doc);
32116 0 : Py_CLEAR(m->func_globals);
32117 0 : Py_CLEAR(m->func_code);
32118 : #if !CYTHON_COMPILING_IN_LIMITED_API
32119 : #if PY_VERSION_HEX < 0x030900B1
32120 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
32121 : #else
32122 0 : {
32123 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
32124 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
32125 0 : Py_XDECREF(cls);
32126 : }
32127 : #endif
32128 : #endif
32129 0 : Py_CLEAR(m->defaults_tuple);
32130 0 : Py_CLEAR(m->defaults_kwdict);
32131 0 : Py_CLEAR(m->func_annotations);
32132 0 : Py_CLEAR(m->func_is_coroutine);
32133 0 : if (m->defaults) {
32134 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32135 : int i;
32136 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32137 0 : Py_XDECREF(pydefaults[i]);
32138 0 : PyObject_Free(m->defaults);
32139 0 : m->defaults = NULL;
32140 : }
32141 0 : return 0;
32142 : }
32143 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
32144 : {
32145 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
32146 0 : PyObject_ClearWeakRefs((PyObject *) m);
32147 0 : __Pyx_CyFunction_clear(m);
32148 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
32149 0 : }
32150 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
32151 : {
32152 0 : PyObject_GC_UnTrack(m);
32153 0 : __Pyx__CyFunction_dealloc(m);
32154 0 : }
32155 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
32156 : {
32157 0 : Py_VISIT(m->func_closure);
32158 : #if CYTHON_COMPILING_IN_LIMITED_API
32159 : Py_VISIT(m->func);
32160 : #else
32161 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
32162 : #endif
32163 0 : Py_VISIT(m->func_dict);
32164 0 : Py_VISIT(m->func_name);
32165 0 : Py_VISIT(m->func_qualname);
32166 0 : Py_VISIT(m->func_doc);
32167 0 : Py_VISIT(m->func_globals);
32168 0 : Py_VISIT(m->func_code);
32169 : #if !CYTHON_COMPILING_IN_LIMITED_API
32170 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
32171 : #endif
32172 0 : Py_VISIT(m->defaults_tuple);
32173 0 : Py_VISIT(m->defaults_kwdict);
32174 0 : Py_VISIT(m->func_is_coroutine);
32175 0 : if (m->defaults) {
32176 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32177 : int i;
32178 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32179 0 : Py_VISIT(pydefaults[i]);
32180 : }
32181 : return 0;
32182 : }
32183 : static PyObject*
32184 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
32185 : {
32186 : #if PY_MAJOR_VERSION >= 3
32187 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
32188 0 : op->func_qualname, (void *)op);
32189 : #else
32190 : return PyString_FromFormat("<cyfunction %s at %p>",
32191 : PyString_AsString(op->func_qualname), (void *)op);
32192 : #endif
32193 : }
32194 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
32195 : #if CYTHON_COMPILING_IN_LIMITED_API
32196 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
32197 : PyObject *py_name = NULL;
32198 : PyCFunction meth;
32199 : int flags;
32200 : meth = PyCFunction_GetFunction(f);
32201 : if (unlikely(!meth)) return NULL;
32202 : flags = PyCFunction_GetFlags(f);
32203 : if (unlikely(flags < 0)) return NULL;
32204 : #else
32205 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
32206 0 : PyCFunction meth = f->m_ml->ml_meth;
32207 0 : int flags = f->m_ml->ml_flags;
32208 : #endif
32209 0 : Py_ssize_t size;
32210 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
32211 0 : case METH_VARARGS:
32212 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
32213 0 : return (*meth)(self, arg);
32214 : break;
32215 0 : case METH_VARARGS | METH_KEYWORDS:
32216 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
32217 0 : case METH_NOARGS:
32218 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32219 : #if CYTHON_ASSUME_SAFE_MACROS
32220 0 : size = PyTuple_GET_SIZE(arg);
32221 : #else
32222 : size = PyTuple_Size(arg);
32223 : if (unlikely(size < 0)) return NULL;
32224 : #endif
32225 0 : if (likely(size == 0))
32226 0 : return (*meth)(self, NULL);
32227 : #if CYTHON_COMPILING_IN_LIMITED_API
32228 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32229 : if (!py_name) return NULL;
32230 : PyErr_Format(PyExc_TypeError,
32231 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32232 : py_name, size);
32233 : Py_DECREF(py_name);
32234 : #else
32235 0 : PyErr_Format(PyExc_TypeError,
32236 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32237 0 : f->m_ml->ml_name, size);
32238 : #endif
32239 0 : return NULL;
32240 : }
32241 : break;
32242 0 : case METH_O:
32243 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32244 : #if CYTHON_ASSUME_SAFE_MACROS
32245 0 : size = PyTuple_GET_SIZE(arg);
32246 : #else
32247 : size = PyTuple_Size(arg);
32248 : if (unlikely(size < 0)) return NULL;
32249 : #endif
32250 0 : if (likely(size == 1)) {
32251 0 : PyObject *result, *arg0;
32252 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32253 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
32254 : #else
32255 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
32256 : #endif
32257 0 : result = (*meth)(self, arg0);
32258 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32259 : Py_DECREF(arg0);
32260 : #endif
32261 0 : return result;
32262 : }
32263 : #if CYTHON_COMPILING_IN_LIMITED_API
32264 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32265 : if (!py_name) return NULL;
32266 : PyErr_Format(PyExc_TypeError,
32267 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32268 : py_name, size);
32269 : Py_DECREF(py_name);
32270 : #else
32271 0 : PyErr_Format(PyExc_TypeError,
32272 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32273 0 : f->m_ml->ml_name, size);
32274 : #endif
32275 0 : return NULL;
32276 : }
32277 : break;
32278 0 : default:
32279 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32280 0 : return NULL;
32281 : }
32282 : #if CYTHON_COMPILING_IN_LIMITED_API
32283 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32284 : if (!py_name) return NULL;
32285 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
32286 : py_name);
32287 : Py_DECREF(py_name);
32288 : #else
32289 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
32290 0 : f->m_ml->ml_name);
32291 : #endif
32292 0 : return NULL;
32293 : }
32294 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
32295 0 : PyObject *self, *result;
32296 : #if CYTHON_COMPILING_IN_LIMITED_API
32297 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
32298 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
32299 : #else
32300 0 : self = ((PyCFunctionObject*)func)->m_self;
32301 : #endif
32302 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
32303 0 : return result;
32304 : }
32305 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
32306 0 : PyObject *result;
32307 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
32308 : #if CYTHON_METH_FASTCALL
32309 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
32310 0 : if (vc) {
32311 : #if CYTHON_ASSUME_SAFE_MACROS
32312 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
32313 : #else
32314 : (void) &__Pyx_PyVectorcall_FastCallDict;
32315 : return PyVectorcall_Call(func, args, kw);
32316 : #endif
32317 : }
32318 : #endif
32319 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32320 0 : Py_ssize_t argc;
32321 0 : PyObject *new_args;
32322 0 : PyObject *self;
32323 : #if CYTHON_ASSUME_SAFE_MACROS
32324 0 : argc = PyTuple_GET_SIZE(args);
32325 : #else
32326 : argc = PyTuple_Size(args);
32327 : if (unlikely(!argc) < 0) return NULL;
32328 : #endif
32329 0 : new_args = PyTuple_GetSlice(args, 1, argc);
32330 0 : if (unlikely(!new_args))
32331 : return NULL;
32332 0 : self = PyTuple_GetItem(args, 0);
32333 0 : if (unlikely(!self)) {
32334 0 : Py_DECREF(new_args);
32335 : #if PY_MAJOR_VERSION > 2
32336 0 : PyErr_Format(PyExc_TypeError,
32337 : "unbound method %.200S() needs an argument",
32338 : cyfunc->func_qualname);
32339 : #else
32340 : PyErr_SetString(PyExc_TypeError,
32341 : "unbound method needs an argument");
32342 : #endif
32343 0 : return NULL;
32344 : }
32345 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
32346 0 : Py_DECREF(new_args);
32347 : } else {
32348 0 : result = __Pyx_CyFunction_Call(func, args, kw);
32349 : }
32350 : return result;
32351 : }
32352 : #if CYTHON_METH_FASTCALL
32353 1001 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
32354 : {
32355 1001 : int ret = 0;
32356 1001 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32357 0 : if (unlikely(nargs < 1)) {
32358 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
32359 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
32360 0 : return -1;
32361 : }
32362 : ret = 1;
32363 : }
32364 1001 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
32365 0 : PyErr_Format(PyExc_TypeError,
32366 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
32367 0 : return -1;
32368 : }
32369 : return ret;
32370 : }
32371 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32372 : {
32373 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32374 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32375 : #if CYTHON_BACKPORT_VECTORCALL
32376 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32377 : #else
32378 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32379 : #endif
32380 0 : PyObject *self;
32381 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
32382 0 : case 1:
32383 0 : self = args[0];
32384 0 : args += 1;
32385 0 : nargs -= 1;
32386 0 : break;
32387 0 : case 0:
32388 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32389 0 : break;
32390 : default:
32391 : return NULL;
32392 : }
32393 0 : if (unlikely(nargs != 0)) {
32394 0 : PyErr_Format(PyExc_TypeError,
32395 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32396 : def->ml_name, nargs);
32397 0 : return NULL;
32398 : }
32399 0 : return def->ml_meth(self, NULL);
32400 : }
32401 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32402 : {
32403 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32404 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32405 : #if CYTHON_BACKPORT_VECTORCALL
32406 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32407 : #else
32408 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32409 : #endif
32410 0 : PyObject *self;
32411 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
32412 0 : case 1:
32413 0 : self = args[0];
32414 0 : args += 1;
32415 0 : nargs -= 1;
32416 0 : break;
32417 0 : case 0:
32418 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32419 0 : break;
32420 : default:
32421 : return NULL;
32422 : }
32423 0 : if (unlikely(nargs != 1)) {
32424 0 : PyErr_Format(PyExc_TypeError,
32425 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32426 : def->ml_name, nargs);
32427 0 : return NULL;
32428 : }
32429 0 : return def->ml_meth(self, args[0]);
32430 : }
32431 1001 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32432 : {
32433 1001 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32434 1001 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32435 : #if CYTHON_BACKPORT_VECTORCALL
32436 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32437 : #else
32438 1001 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32439 : #endif
32440 1001 : PyObject *self;
32441 1001 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
32442 0 : case 1:
32443 0 : self = args[0];
32444 0 : args += 1;
32445 0 : nargs -= 1;
32446 0 : break;
32447 1001 : case 0:
32448 1001 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32449 1001 : break;
32450 : default:
32451 : return NULL;
32452 : }
32453 1001 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
32454 : }
32455 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32456 : {
32457 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32458 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32459 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
32460 : #if CYTHON_BACKPORT_VECTORCALL
32461 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32462 : #else
32463 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32464 : #endif
32465 0 : PyObject *self;
32466 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
32467 0 : case 1:
32468 0 : self = args[0];
32469 0 : args += 1;
32470 0 : nargs -= 1;
32471 0 : break;
32472 0 : case 0:
32473 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32474 0 : break;
32475 : default:
32476 : return NULL;
32477 : }
32478 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
32479 : }
32480 : #endif
32481 : #if CYTHON_USE_TYPE_SPECS
32482 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
32483 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
32484 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
32485 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
32486 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
32487 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
32488 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
32489 : {Py_tp_members, (void *)__pyx_CyFunction_members},
32490 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
32491 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
32492 : {0, 0},
32493 : };
32494 : static PyType_Spec __pyx_CyFunctionType_spec = {
32495 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32496 : sizeof(__pyx_CyFunctionObject),
32497 : 0,
32498 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32499 : Py_TPFLAGS_METHOD_DESCRIPTOR |
32500 : #endif
32501 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
32502 : _Py_TPFLAGS_HAVE_VECTORCALL |
32503 : #endif
32504 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32505 : __pyx_CyFunctionType_slots
32506 : };
32507 : #else
32508 : static PyTypeObject __pyx_CyFunctionType_type = {
32509 : PyVarObject_HEAD_INIT(0, 0)
32510 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32511 : sizeof(__pyx_CyFunctionObject),
32512 : 0,
32513 : (destructor) __Pyx_CyFunction_dealloc,
32514 : #if !CYTHON_METH_FASTCALL
32515 : 0,
32516 : #elif CYTHON_BACKPORT_VECTORCALL
32517 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
32518 : #else
32519 : offsetof(PyCFunctionObject, vectorcall),
32520 : #endif
32521 : 0,
32522 : 0,
32523 : #if PY_MAJOR_VERSION < 3
32524 : 0,
32525 : #else
32526 : 0,
32527 : #endif
32528 : (reprfunc) __Pyx_CyFunction_repr,
32529 : 0,
32530 : 0,
32531 : 0,
32532 : 0,
32533 : __Pyx_CyFunction_CallAsMethod,
32534 : 0,
32535 : 0,
32536 : 0,
32537 : 0,
32538 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32539 : Py_TPFLAGS_METHOD_DESCRIPTOR |
32540 : #endif
32541 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
32542 : _Py_TPFLAGS_HAVE_VECTORCALL |
32543 : #endif
32544 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32545 : 0,
32546 : (traverseproc) __Pyx_CyFunction_traverse,
32547 : (inquiry) __Pyx_CyFunction_clear,
32548 : 0,
32549 : #if PY_VERSION_HEX < 0x030500A0
32550 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
32551 : #else
32552 : offsetof(PyCFunctionObject, m_weakreflist),
32553 : #endif
32554 : 0,
32555 : 0,
32556 : __pyx_CyFunction_methods,
32557 : __pyx_CyFunction_members,
32558 : __pyx_CyFunction_getsets,
32559 : 0,
32560 : 0,
32561 : __Pyx_PyMethod_New,
32562 : 0,
32563 : offsetof(__pyx_CyFunctionObject, func_dict),
32564 : 0,
32565 : 0,
32566 : 0,
32567 : 0,
32568 : 0,
32569 : 0,
32570 : 0,
32571 : 0,
32572 : 0,
32573 : 0,
32574 : 0,
32575 : 0,
32576 : #if PY_VERSION_HEX >= 0x030400a1
32577 : 0,
32578 : #endif
32579 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
32580 : 0,
32581 : #endif
32582 : #if __PYX_NEED_TP_PRINT_SLOT
32583 : 0,
32584 : #endif
32585 : #if PY_VERSION_HEX >= 0x030C0000
32586 : 0,
32587 : #endif
32588 : #if PY_VERSION_HEX >= 0x030d00A4
32589 : 0,
32590 : #endif
32591 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
32592 : 0,
32593 : #endif
32594 : };
32595 : #endif
32596 1 : static int __pyx_CyFunction_init(PyObject *module) {
32597 : #if CYTHON_USE_TYPE_SPECS
32598 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
32599 : #else
32600 1 : CYTHON_UNUSED_VAR(module);
32601 1 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
32602 : #endif
32603 1 : if (unlikely(__pyx_CyFunctionType == NULL)) {
32604 0 : return -1;
32605 : }
32606 : return 0;
32607 : }
32608 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
32609 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32610 : m->defaults = PyObject_Malloc(size);
32611 : if (unlikely(!m->defaults))
32612 : return PyErr_NoMemory();
32613 : memset(m->defaults, 0, size);
32614 : m->defaults_pyobjects = pyobjects;
32615 : m->defaults_size = size;
32616 : return m->defaults;
32617 : }
32618 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
32619 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32620 : m->defaults_tuple = tuple;
32621 : Py_INCREF(tuple);
32622 : }
32623 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
32624 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32625 : m->defaults_kwdict = dict;
32626 : Py_INCREF(dict);
32627 : }
32628 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
32629 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32630 : m->func_annotations = dict;
32631 : Py_INCREF(dict);
32632 : }
32633 :
32634 : /* CythonFunction */
32635 1 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
32636 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32637 1 : PyObject *op = __Pyx_CyFunction_Init(
32638 1 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
32639 : ml, flags, qualname, closure, module, globals, code
32640 : );
32641 1 : if (likely(op)) {
32642 1 : PyObject_GC_Track(op);
32643 : }
32644 1 : return op;
32645 : }
32646 :
32647 : /* CLineInTraceback */
32648 : #ifndef CYTHON_CLINE_IN_TRACEBACK
32649 0 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
32650 0 : PyObject *use_cline;
32651 0 : PyObject *ptype, *pvalue, *ptraceback;
32652 : #if CYTHON_COMPILING_IN_CPYTHON
32653 0 : PyObject **cython_runtime_dict;
32654 : #endif
32655 0 : CYTHON_MAYBE_UNUSED_VAR(tstate);
32656 0 : if (unlikely(!__pyx_cython_runtime)) {
32657 : return c_line;
32658 : }
32659 0 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
32660 : #if CYTHON_COMPILING_IN_CPYTHON
32661 0 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
32662 0 : if (likely(cython_runtime_dict)) {
32663 0 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
32664 : use_cline, *cython_runtime_dict,
32665 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
32666 : } else
32667 : #endif
32668 : {
32669 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
32670 0 : if (use_cline_obj) {
32671 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
32672 0 : Py_DECREF(use_cline_obj);
32673 : } else {
32674 0 : PyErr_Clear();
32675 : use_cline = NULL;
32676 : }
32677 : }
32678 0 : if (!use_cline) {
32679 0 : c_line = 0;
32680 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
32681 : }
32682 0 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
32683 : c_line = 0;
32684 : }
32685 0 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
32686 : return c_line;
32687 : }
32688 : #endif
32689 :
32690 : /* CodeObjectCache */
32691 : #if !CYTHON_COMPILING_IN_LIMITED_API
32692 0 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
32693 0 : int start = 0, mid = 0, end = count - 1;
32694 0 : if (end >= 0 && code_line > entries[end].code_line) {
32695 : return count;
32696 : }
32697 0 : while (start < end) {
32698 0 : mid = start + (end - start) / 2;
32699 0 : if (code_line < entries[mid].code_line) {
32700 : end = mid;
32701 0 : } else if (code_line > entries[mid].code_line) {
32702 0 : start = mid + 1;
32703 : } else {
32704 0 : return mid;
32705 : }
32706 : }
32707 0 : if (code_line <= entries[mid].code_line) {
32708 : return mid;
32709 : } else {
32710 0 : return mid + 1;
32711 : }
32712 : }
32713 0 : static PyCodeObject *__pyx_find_code_object(int code_line) {
32714 0 : PyCodeObject* code_object;
32715 0 : int pos;
32716 0 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
32717 : return NULL;
32718 : }
32719 0 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
32720 0 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
32721 : return NULL;
32722 : }
32723 0 : code_object = __pyx_code_cache.entries[pos].code_object;
32724 0 : Py_INCREF(code_object);
32725 : return code_object;
32726 : }
32727 0 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
32728 0 : int pos, i;
32729 0 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
32730 0 : if (unlikely(!code_line)) {
32731 : return;
32732 : }
32733 0 : if (unlikely(!entries)) {
32734 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
32735 0 : if (likely(entries)) {
32736 0 : __pyx_code_cache.entries = entries;
32737 0 : __pyx_code_cache.max_count = 64;
32738 0 : __pyx_code_cache.count = 1;
32739 0 : entries[0].code_line = code_line;
32740 0 : entries[0].code_object = code_object;
32741 0 : Py_INCREF(code_object);
32742 : }
32743 0 : return;
32744 : }
32745 0 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
32746 0 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
32747 0 : PyCodeObject* tmp = entries[pos].code_object;
32748 0 : entries[pos].code_object = code_object;
32749 0 : Py_DECREF(tmp);
32750 0 : return;
32751 : }
32752 0 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
32753 0 : int new_max = __pyx_code_cache.max_count + 64;
32754 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
32755 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
32756 0 : if (unlikely(!entries)) {
32757 : return;
32758 : }
32759 0 : __pyx_code_cache.entries = entries;
32760 0 : __pyx_code_cache.max_count = new_max;
32761 : }
32762 0 : for (i=__pyx_code_cache.count; i>pos; i--) {
32763 0 : entries[i] = entries[i-1];
32764 : }
32765 0 : entries[pos].code_line = code_line;
32766 0 : entries[pos].code_object = code_object;
32767 0 : __pyx_code_cache.count++;
32768 0 : Py_INCREF(code_object);
32769 : }
32770 : #endif
32771 :
32772 : /* AddTraceback */
32773 : #include "compile.h"
32774 : #include "frameobject.h"
32775 : #include "traceback.h"
32776 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
32777 : #ifndef Py_BUILD_CORE
32778 : #define Py_BUILD_CORE 1
32779 : #endif
32780 : #include "internal/pycore_frame.h"
32781 : #endif
32782 : #if CYTHON_COMPILING_IN_LIMITED_API
32783 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
32784 : PyObject *firstlineno, PyObject *name) {
32785 : PyObject *replace = NULL;
32786 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
32787 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
32788 : replace = PyObject_GetAttrString(code, "replace");
32789 : if (likely(replace)) {
32790 : PyObject *result;
32791 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
32792 : Py_DECREF(replace);
32793 : return result;
32794 : }
32795 : PyErr_Clear();
32796 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
32797 : {
32798 : PyObject *compiled = NULL, *result = NULL;
32799 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
32800 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
32801 : compiled = Py_CompileString(
32802 : "out = type(code)(\n"
32803 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
32804 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
32805 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
32806 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
32807 : if (!compiled) return NULL;
32808 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
32809 : Py_DECREF(compiled);
32810 : if (!result) PyErr_Print();
32811 : Py_DECREF(result);
32812 : result = PyDict_GetItemString(scratch_dict, "out");
32813 : if (result) Py_INCREF(result);
32814 : return result;
32815 : }
32816 : #else
32817 : return NULL;
32818 : #endif
32819 : }
32820 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
32821 : int py_line, const char *filename) {
32822 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
32823 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
32824 : PyObject *exc_type, *exc_value, *exc_traceback;
32825 : int success = 0;
32826 : if (c_line) {
32827 : (void) __pyx_cfilenm;
32828 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
32829 : }
32830 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
32831 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
32832 : if (unlikely(!code_object)) goto bad;
32833 : py_py_line = PyLong_FromLong(py_line);
32834 : if (unlikely(!py_py_line)) goto bad;
32835 : py_funcname = PyUnicode_FromString(funcname);
32836 : if (unlikely(!py_funcname)) goto bad;
32837 : dict = PyDict_New();
32838 : if (unlikely(!dict)) goto bad;
32839 : {
32840 : PyObject *old_code_object = code_object;
32841 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
32842 : Py_DECREF(old_code_object);
32843 : }
32844 : if (unlikely(!code_object)) goto bad;
32845 : getframe = PySys_GetObject("_getframe");
32846 : if (unlikely(!getframe)) goto bad;
32847 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
32848 : frame = PyEval_EvalCode(code_object, dict, dict);
32849 : if (unlikely(!frame) || frame == Py_None) goto bad;
32850 : success = 1;
32851 : bad:
32852 : PyErr_Restore(exc_type, exc_value, exc_traceback);
32853 : Py_XDECREF(code_object);
32854 : Py_XDECREF(py_py_line);
32855 : Py_XDECREF(py_funcname);
32856 : Py_XDECREF(dict);
32857 : Py_XDECREF(replace);
32858 : if (success) {
32859 : PyTraceBack_Here(
32860 : (struct _frame*)frame);
32861 : }
32862 : Py_XDECREF(frame);
32863 : }
32864 : #else
32865 0 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
32866 : const char *funcname, int c_line,
32867 : int py_line, const char *filename) {
32868 0 : PyCodeObject *py_code = NULL;
32869 0 : PyObject *py_funcname = NULL;
32870 : #if PY_MAJOR_VERSION < 3
32871 : PyObject *py_srcfile = NULL;
32872 : py_srcfile = PyString_FromString(filename);
32873 : if (!py_srcfile) goto bad;
32874 : #endif
32875 0 : if (c_line) {
32876 : #if PY_MAJOR_VERSION < 3
32877 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
32878 : if (!py_funcname) goto bad;
32879 : #else
32880 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
32881 0 : if (!py_funcname) goto bad;
32882 0 : funcname = PyUnicode_AsUTF8(py_funcname);
32883 0 : if (!funcname) goto bad;
32884 : #endif
32885 : }
32886 : else {
32887 : #if PY_MAJOR_VERSION < 3
32888 : py_funcname = PyString_FromString(funcname);
32889 : if (!py_funcname) goto bad;
32890 : #endif
32891 : }
32892 : #if PY_MAJOR_VERSION < 3
32893 : py_code = __Pyx_PyCode_New(
32894 : 0,
32895 : 0,
32896 : 0,
32897 : 0,
32898 : 0,
32899 : 0,
32900 : __pyx_empty_bytes, /*PyObject *code,*/
32901 : __pyx_empty_tuple, /*PyObject *consts,*/
32902 : __pyx_empty_tuple, /*PyObject *names,*/
32903 : __pyx_empty_tuple, /*PyObject *varnames,*/
32904 : __pyx_empty_tuple, /*PyObject *freevars,*/
32905 : __pyx_empty_tuple, /*PyObject *cellvars,*/
32906 : py_srcfile, /*PyObject *filename,*/
32907 : py_funcname, /*PyObject *name,*/
32908 : py_line,
32909 : __pyx_empty_bytes /*PyObject *lnotab*/
32910 : );
32911 : Py_DECREF(py_srcfile);
32912 : #else
32913 0 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
32914 : #endif
32915 0 : Py_XDECREF(py_funcname);
32916 0 : return py_code;
32917 0 : bad:
32918 0 : Py_XDECREF(py_funcname);
32919 : #if PY_MAJOR_VERSION < 3
32920 : Py_XDECREF(py_srcfile);
32921 : #endif
32922 0 : return NULL;
32923 : }
32924 0 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
32925 : int py_line, const char *filename) {
32926 0 : PyCodeObject *py_code = 0;
32927 0 : PyFrameObject *py_frame = 0;
32928 0 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
32929 0 : PyObject *ptype, *pvalue, *ptraceback;
32930 0 : if (c_line) {
32931 0 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
32932 : }
32933 0 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
32934 0 : if (!py_code) {
32935 0 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
32936 0 : py_code = __Pyx_CreateCodeObjectForTraceback(
32937 : funcname, c_line, py_line, filename);
32938 0 : if (!py_code) {
32939 : /* If the code object creation fails, then we should clear the
32940 : fetched exception references and propagate the new exception */
32941 0 : Py_XDECREF(ptype);
32942 0 : Py_XDECREF(pvalue);
32943 0 : Py_XDECREF(ptraceback);
32944 0 : goto bad;
32945 : }
32946 0 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
32947 0 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
32948 : }
32949 0 : py_frame = PyFrame_New(
32950 : tstate, /*PyThreadState *tstate,*/
32951 : py_code, /*PyCodeObject *code,*/
32952 : __pyx_d, /*PyObject *globals,*/
32953 : 0 /*PyObject *locals*/
32954 : );
32955 0 : if (!py_frame) goto bad;
32956 0 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
32957 0 : PyTraceBack_Here(py_frame);
32958 0 : bad:
32959 0 : Py_XDECREF(py_code);
32960 0 : Py_XDECREF(py_frame);
32961 0 : }
32962 : #endif
32963 :
32964 : #if PY_MAJOR_VERSION < 3
32965 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
32966 : __Pyx_TypeName obj_type_name;
32967 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
32968 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
32969 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
32970 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
32971 : PyErr_Format(PyExc_TypeError,
32972 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
32973 : obj_type_name);
32974 : __Pyx_DECREF_TypeName(obj_type_name);
32975 : return -1;
32976 : }
32977 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
32978 : PyObject *obj = view->obj;
32979 : if (!obj) return;
32980 : if (PyObject_CheckBuffer(obj)) {
32981 : PyBuffer_Release(view);
32982 : return;
32983 : }
32984 : if ((0)) {}
32985 : view->obj = NULL;
32986 : Py_DECREF(obj);
32987 : }
32988 : #endif
32989 :
32990 :
32991 : /* MemviewSliceIsContig */
32992 : static int
32993 0 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
32994 : {
32995 0 : int i, index, step, start;
32996 0 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
32997 0 : if (order == 'F') {
32998 : step = 1;
32999 : start = 0;
33000 : } else {
33001 0 : step = -1;
33002 0 : start = ndim - 1;
33003 : }
33004 0 : for (i = 0; i < ndim; i++) {
33005 0 : index = start + step * i;
33006 0 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
33007 : return 0;
33008 0 : itemsize *= mvs.shape[index];
33009 : }
33010 : return 1;
33011 : }
33012 :
33013 : /* OverlappingSlices */
33014 : static void
33015 0 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
33016 : void **out_start, void **out_end,
33017 : int ndim, size_t itemsize)
33018 : {
33019 0 : char *start, *end;
33020 0 : int i;
33021 0 : start = end = slice->data;
33022 0 : for (i = 0; i < ndim; i++) {
33023 0 : Py_ssize_t stride = slice->strides[i];
33024 0 : Py_ssize_t extent = slice->shape[i];
33025 0 : if (extent == 0) {
33026 0 : *out_start = *out_end = start;
33027 0 : return;
33028 : } else {
33029 0 : if (stride > 0)
33030 0 : end += stride * (extent - 1);
33031 : else
33032 0 : start += stride * (extent - 1);
33033 : }
33034 : }
33035 0 : *out_start = start;
33036 0 : *out_end = end + itemsize;
33037 : }
33038 : static int
33039 0 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
33040 : __Pyx_memviewslice *slice2,
33041 : int ndim, size_t itemsize)
33042 : {
33043 0 : void *start1, *end1, *start2, *end2;
33044 0 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
33045 0 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
33046 0 : return (start1 < end2) && (start2 < end1);
33047 : }
33048 :
33049 : /* IsLittleEndian */
33050 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
33051 : {
33052 0 : union {
33053 : uint32_t u32;
33054 : uint8_t u8[4];
33055 : } S;
33056 0 : S.u32 = 0x01020304;
33057 0 : return S.u8[0] == 4;
33058 : }
33059 :
33060 : /* BufferFormatCheck */
33061 10006 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
33062 : __Pyx_BufFmt_StackElem* stack,
33063 : __Pyx_TypeInfo* type) {
33064 10006 : stack[0].field = &ctx->root;
33065 10006 : stack[0].parent_offset = 0;
33066 10006 : ctx->root.type = type;
33067 10006 : ctx->root.name = "buffer dtype";
33068 10006 : ctx->root.offset = 0;
33069 10006 : ctx->head = stack;
33070 10006 : ctx->head->field = &ctx->root;
33071 10006 : ctx->fmt_offset = 0;
33072 10006 : ctx->head->parent_offset = 0;
33073 10006 : ctx->new_packmode = '@';
33074 10006 : ctx->enc_packmode = '@';
33075 10006 : ctx->new_count = 1;
33076 10006 : ctx->enc_count = 0;
33077 10006 : ctx->enc_type = 0;
33078 10006 : ctx->is_complex = 0;
33079 10006 : ctx->is_valid_array = 0;
33080 10006 : ctx->struct_alignment = 0;
33081 10006 : while (type->typegroup == 'S') {
33082 0 : ++ctx->head;
33083 0 : ctx->head->field = type->fields;
33084 0 : ctx->head->parent_offset = 0;
33085 0 : type = type->fields->type;
33086 : }
33087 10006 : }
33088 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
33089 0 : int count;
33090 0 : const char* t = *ts;
33091 0 : if (*t < '0' || *t > '9') {
33092 : return -1;
33093 : } else {
33094 0 : count = *t++ - '0';
33095 0 : while (*t >= '0' && *t <= '9') {
33096 0 : count *= 10;
33097 0 : count += *t++ - '0';
33098 : }
33099 : }
33100 0 : *ts = t;
33101 0 : return count;
33102 : }
33103 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
33104 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
33105 0 : if (number == -1)
33106 0 : PyErr_Format(PyExc_ValueError,\
33107 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
33108 0 : return number;
33109 : }
33110 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
33111 0 : PyErr_Format(PyExc_ValueError,
33112 : "Unexpected format string character: '%c'", ch);
33113 : }
33114 0 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
33115 0 : switch (ch) {
33116 : case '?': return "'bool'";
33117 0 : case 'c': return "'char'";
33118 0 : case 'b': return "'signed char'";
33119 0 : case 'B': return "'unsigned char'";
33120 0 : case 'h': return "'short'";
33121 0 : case 'H': return "'unsigned short'";
33122 0 : case 'i': return "'int'";
33123 0 : case 'I': return "'unsigned int'";
33124 0 : case 'l': return "'long'";
33125 0 : case 'L': return "'unsigned long'";
33126 0 : case 'q': return "'long long'";
33127 0 : case 'Q': return "'unsigned long long'";
33128 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
33129 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
33130 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
33131 0 : case 'T': return "a struct";
33132 0 : case 'O': return "Python object";
33133 0 : case 'P': return "a pointer";
33134 0 : case 's': case 'p': return "a string";
33135 0 : case 0: return "end";
33136 0 : default: return "unparsable format string";
33137 : }
33138 : }
33139 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
33140 0 : switch (ch) {
33141 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33142 0 : case 'h': case 'H': return 2;
33143 : case 'i': case 'I': case 'l': case 'L': return 4;
33144 : case 'q': case 'Q': return 8;
33145 0 : case 'f': return (is_complex ? 8 : 4);
33146 0 : case 'd': return (is_complex ? 16 : 8);
33147 0 : case 'g': {
33148 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
33149 0 : return 0;
33150 : }
33151 : case 'O': case 'P': return sizeof(void*);
33152 0 : default:
33153 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33154 0 : return 0;
33155 : }
33156 : }
33157 10006 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
33158 10006 : switch (ch) {
33159 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33160 0 : case 'h': case 'H': return sizeof(short);
33161 : case 'i': case 'I': return sizeof(int);
33162 : case 'l': case 'L': return sizeof(long);
33163 : #ifdef HAVE_LONG_LONG
33164 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
33165 : #endif
33166 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
33167 7003 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
33168 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
33169 : case 'O': case 'P': return sizeof(void*);
33170 0 : default: {
33171 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33172 0 : return 0;
33173 : }
33174 : }
33175 : }
33176 : typedef struct { char c; short x; } __Pyx_st_short;
33177 : typedef struct { char c; int x; } __Pyx_st_int;
33178 : typedef struct { char c; long x; } __Pyx_st_long;
33179 : typedef struct { char c; float x; } __Pyx_st_float;
33180 : typedef struct { char c; double x; } __Pyx_st_double;
33181 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
33182 : typedef struct { char c; void *x; } __Pyx_st_void_p;
33183 : #ifdef HAVE_LONG_LONG
33184 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
33185 : #endif
33186 10006 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
33187 10006 : CYTHON_UNUSED_VAR(is_complex);
33188 10006 : switch (ch) {
33189 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33190 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
33191 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
33192 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
33193 : #ifdef HAVE_LONG_LONG
33194 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
33195 : #endif
33196 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
33197 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
33198 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
33199 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
33200 0 : default:
33201 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33202 0 : return 0;
33203 : }
33204 : }
33205 : /* These are for computing the padding at the end of the struct to align
33206 : on the first member of the struct. This will probably the same as above,
33207 : but we don't have any guarantees.
33208 : */
33209 : typedef struct { short x; char c; } __Pyx_pad_short;
33210 : typedef struct { int x; char c; } __Pyx_pad_int;
33211 : typedef struct { long x; char c; } __Pyx_pad_long;
33212 : typedef struct { float x; char c; } __Pyx_pad_float;
33213 : typedef struct { double x; char c; } __Pyx_pad_double;
33214 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
33215 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
33216 : #ifdef HAVE_LONG_LONG
33217 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
33218 : #endif
33219 10006 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
33220 10006 : CYTHON_UNUSED_VAR(is_complex);
33221 10006 : switch (ch) {
33222 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33223 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
33224 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
33225 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
33226 : #ifdef HAVE_LONG_LONG
33227 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
33228 : #endif
33229 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
33230 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
33231 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
33232 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
33233 0 : default:
33234 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33235 0 : return 0;
33236 : }
33237 : }
33238 10006 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
33239 10006 : switch (ch) {
33240 : case 'c':
33241 : return 'H';
33242 2002 : case 'b': case 'h': case 'i':
33243 2002 : case 'l': case 'q': case 's': case 'p':
33244 2002 : return 'I';
33245 1001 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
33246 1001 : return 'U';
33247 7003 : case 'f': case 'd': case 'g':
33248 7003 : return (is_complex ? 'C' : 'R');
33249 0 : case 'O':
33250 0 : return 'O';
33251 0 : case 'P':
33252 0 : return 'P';
33253 0 : default: {
33254 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33255 0 : return 0;
33256 : }
33257 : }
33258 : }
33259 0 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
33260 0 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
33261 0 : const char* expected;
33262 0 : const char* quote;
33263 0 : if (ctx->head == NULL) {
33264 : expected = "end";
33265 : quote = "";
33266 : } else {
33267 0 : expected = ctx->head->field->type->name;
33268 0 : quote = "'";
33269 : }
33270 0 : PyErr_Format(PyExc_ValueError,
33271 : "Buffer dtype mismatch, expected %s%s%s but got %s",
33272 : quote, expected, quote,
33273 0 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
33274 0 : } else {
33275 0 : __Pyx_StructField* field = ctx->head->field;
33276 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
33277 0 : PyErr_Format(PyExc_ValueError,
33278 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
33279 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
33280 0 : parent->type->name, field->name);
33281 : }
33282 0 : }
33283 20012 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
33284 20012 : char group;
33285 20012 : size_t size, offset, arraysize = 1;
33286 20012 : if (ctx->enc_type == 0) return 0;
33287 10006 : if (ctx->head->field->type->arraysize[0]) {
33288 0 : int i, ndim = 0;
33289 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
33290 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
33291 0 : ndim = 1;
33292 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
33293 0 : PyErr_Format(PyExc_ValueError,
33294 : "Expected a dimension of size %zu, got %zu",
33295 : ctx->head->field->type->arraysize[0], ctx->enc_count);
33296 0 : return -1;
33297 : }
33298 : }
33299 0 : if (!ctx->is_valid_array) {
33300 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
33301 : ctx->head->field->type->ndim, ndim);
33302 0 : return -1;
33303 : }
33304 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
33305 0 : arraysize *= ctx->head->field->type->arraysize[i];
33306 : }
33307 0 : ctx->is_valid_array = 0;
33308 0 : ctx->enc_count = 1;
33309 : }
33310 10006 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
33311 10006 : do {
33312 10006 : __Pyx_StructField* field = ctx->head->field;
33313 10006 : __Pyx_TypeInfo* type = field->type;
33314 10006 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
33315 10006 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
33316 : } else {
33317 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
33318 : }
33319 10006 : if (ctx->enc_packmode == '@') {
33320 10006 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
33321 10006 : size_t align_mod_offset;
33322 10006 : if (align_at == 0) return -1;
33323 10006 : align_mod_offset = ctx->fmt_offset % align_at;
33324 10006 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
33325 10006 : if (ctx->struct_alignment == 0)
33326 10006 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
33327 : ctx->is_complex);
33328 : }
33329 10006 : if (type->size != size || type->typegroup != group) {
33330 0 : if (type->typegroup == 'C' && type->fields != NULL) {
33331 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
33332 0 : ++ctx->head;
33333 0 : ctx->head->field = type->fields;
33334 0 : ctx->head->parent_offset = parent_offset;
33335 0 : continue;
33336 0 : }
33337 0 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
33338 : } else {
33339 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33340 0 : return -1;
33341 : }
33342 : }
33343 10006 : offset = ctx->head->parent_offset + field->offset;
33344 10006 : if (ctx->fmt_offset != offset) {
33345 0 : PyErr_Format(PyExc_ValueError,
33346 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
33347 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
33348 0 : return -1;
33349 : }
33350 10006 : ctx->fmt_offset += size;
33351 10006 : if (arraysize)
33352 10006 : ctx->fmt_offset += (arraysize - 1) * size;
33353 10006 : --ctx->enc_count;
33354 10006 : while (1) {
33355 10006 : if (field == &ctx->root) {
33356 10006 : ctx->head = NULL;
33357 10006 : if (ctx->enc_count != 0) {
33358 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33359 0 : return -1;
33360 : }
33361 : break;
33362 : }
33363 0 : ctx->head->field = ++field;
33364 0 : if (field->type == NULL) {
33365 0 : --ctx->head;
33366 0 : field = ctx->head->field;
33367 0 : continue;
33368 0 : } else if (field->type->typegroup == 'S') {
33369 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
33370 0 : if (field->type->fields->type == NULL) continue;
33371 0 : field = field->type->fields;
33372 0 : ++ctx->head;
33373 0 : ctx->head->field = field;
33374 0 : ctx->head->parent_offset = parent_offset;
33375 0 : break;
33376 : } else {
33377 : break;
33378 : }
33379 : }
33380 10006 : } while (ctx->enc_count);
33381 10006 : ctx->enc_type = 0;
33382 10006 : ctx->is_complex = 0;
33383 10006 : return 0;
33384 : }
33385 : static int
33386 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
33387 : {
33388 0 : const char *ts = *tsp;
33389 0 : int i = 0, number, ndim;
33390 0 : ++ts;
33391 0 : if (ctx->new_count != 1) {
33392 0 : PyErr_SetString(PyExc_ValueError,
33393 : "Cannot handle repeated arrays in format string");
33394 0 : return -1;
33395 : }
33396 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
33397 0 : ndim = ctx->head->field->type->ndim;
33398 0 : while (*ts && *ts != ')') {
33399 0 : switch (*ts) {
33400 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
33401 0 : default: break;
33402 : }
33403 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
33404 0 : if (number == -1) return -1;
33405 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
33406 0 : PyErr_Format(PyExc_ValueError,
33407 : "Expected a dimension of size %zu, got %d",
33408 : ctx->head->field->type->arraysize[i], number);
33409 0 : return -1;
33410 : }
33411 0 : if (*ts != ',' && *ts != ')') {
33412 0 : PyErr_Format(PyExc_ValueError,
33413 : "Expected a comma in format string, got '%c'", *ts);
33414 0 : return -1;
33415 : }
33416 0 : if (*ts == ',') ts++;
33417 0 : i++;
33418 : }
33419 0 : if (i != ndim) {
33420 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
33421 0 : ctx->head->field->type->ndim, i);
33422 0 : return -1;
33423 : }
33424 0 : if (!*ts) {
33425 0 : PyErr_SetString(PyExc_ValueError,
33426 : "Unexpected end of format string, expected ')'");
33427 0 : return -1;
33428 : }
33429 0 : ctx->is_valid_array = 1;
33430 0 : ctx->new_count = 1;
33431 0 : *tsp = ++ts;
33432 0 : return 0;
33433 : }
33434 10006 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
33435 10006 : int got_Z = 0;
33436 20012 : while (1) {
33437 20012 : switch(*ts) {
33438 10006 : case 0:
33439 10006 : if (ctx->enc_type != 0 && ctx->head == NULL) {
33440 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33441 0 : return NULL;
33442 : }
33443 10006 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33444 10006 : if (ctx->head != NULL) {
33445 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33446 0 : return NULL;
33447 : }
33448 : return ts;
33449 0 : case ' ':
33450 0 : case '\r':
33451 0 : case '\n':
33452 0 : ++ts;
33453 0 : break;
33454 0 : case '<':
33455 0 : if (!__Pyx_Is_Little_Endian()) {
33456 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
33457 : return NULL;
33458 : }
33459 0 : ctx->new_packmode = '=';
33460 0 : ++ts;
33461 0 : break;
33462 0 : case '>':
33463 0 : case '!':
33464 0 : if (__Pyx_Is_Little_Endian()) {
33465 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
33466 0 : return NULL;
33467 : }
33468 : ctx->new_packmode = '=';
33469 : ++ts;
33470 : break;
33471 0 : case '=':
33472 0 : case '@':
33473 0 : case '^':
33474 0 : ctx->new_packmode = *ts++;
33475 0 : break;
33476 0 : case 'T':
33477 0 : {
33478 0 : const char* ts_after_sub;
33479 0 : size_t i, struct_count = ctx->new_count;
33480 0 : size_t struct_alignment = ctx->struct_alignment;
33481 0 : ctx->new_count = 1;
33482 0 : ++ts;
33483 0 : if (*ts != '{') {
33484 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
33485 0 : return NULL;
33486 : }
33487 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33488 0 : ctx->enc_type = 0;
33489 0 : ctx->enc_count = 0;
33490 0 : ctx->struct_alignment = 0;
33491 0 : ++ts;
33492 0 : ts_after_sub = ts;
33493 0 : for (i = 0; i != struct_count; ++i) {
33494 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
33495 0 : if (!ts_after_sub) return NULL;
33496 : }
33497 0 : ts = ts_after_sub;
33498 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
33499 : }
33500 : break;
33501 0 : case '}':
33502 0 : {
33503 0 : size_t alignment = ctx->struct_alignment;
33504 0 : ++ts;
33505 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33506 0 : ctx->enc_type = 0;
33507 0 : if (alignment && ctx->fmt_offset % alignment) {
33508 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
33509 : }
33510 : }
33511 : return ts;
33512 0 : case 'x':
33513 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33514 0 : ctx->fmt_offset += ctx->new_count;
33515 0 : ctx->new_count = 1;
33516 0 : ctx->enc_count = 0;
33517 0 : ctx->enc_type = 0;
33518 0 : ctx->enc_packmode = ctx->new_packmode;
33519 0 : ++ts;
33520 0 : break;
33521 0 : case 'Z':
33522 0 : got_Z = 1;
33523 0 : ++ts;
33524 0 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
33525 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
33526 0 : return NULL;
33527 : }
33528 10006 : CYTHON_FALLTHROUGH;
33529 10006 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
33530 10006 : case 'l': case 'L': case 'q': case 'Q':
33531 10006 : case 'f': case 'd': case 'g':
33532 10006 : case 'O': case 'p':
33533 10006 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
33534 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
33535 0 : ctx->enc_count += ctx->new_count;
33536 0 : ctx->new_count = 1;
33537 0 : got_Z = 0;
33538 0 : ++ts;
33539 0 : break;
33540 : }
33541 10006 : CYTHON_FALLTHROUGH;
33542 10006 : case 's':
33543 10006 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33544 10006 : ctx->enc_count = ctx->new_count;
33545 10006 : ctx->enc_packmode = ctx->new_packmode;
33546 10006 : ctx->enc_type = *ts;
33547 10006 : ctx->is_complex = got_Z;
33548 10006 : ++ts;
33549 10006 : ctx->new_count = 1;
33550 10006 : got_Z = 0;
33551 10006 : break;
33552 0 : case ':':
33553 0 : ++ts;
33554 0 : while(*ts != ':') ++ts;
33555 0 : ++ts;
33556 0 : break;
33557 0 : case '(':
33558 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
33559 : break;
33560 0 : default:
33561 0 : {
33562 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
33563 0 : if (number == -1) return NULL;
33564 0 : ctx->new_count = (size_t)number;
33565 : }
33566 : }
33567 : }
33568 : }
33569 :
33570 : /* TypeInfoCompare */
33571 : static int
33572 0 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
33573 : {
33574 0 : int i;
33575 0 : if (!a || !b)
33576 : return 0;
33577 0 : if (a == b)
33578 : return 1;
33579 0 : if (a->size != b->size || a->typegroup != b->typegroup ||
33580 0 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
33581 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
33582 0 : return a->size == b->size;
33583 : } else {
33584 : return 0;
33585 : }
33586 : }
33587 0 : if (a->ndim) {
33588 0 : for (i = 0; i < a->ndim; i++)
33589 0 : if (a->arraysize[i] != b->arraysize[i])
33590 : return 0;
33591 : }
33592 0 : if (a->typegroup == 'S') {
33593 0 : if (a->flags != b->flags)
33594 : return 0;
33595 0 : if (a->fields || b->fields) {
33596 0 : if (!(a->fields && b->fields))
33597 : return 0;
33598 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
33599 0 : __Pyx_StructField *field_a = a->fields + i;
33600 0 : __Pyx_StructField *field_b = b->fields + i;
33601 0 : if (field_a->offset != field_b->offset ||
33602 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
33603 0 : return 0;
33604 : }
33605 0 : return !a->fields[i].type && !b->fields[i].type;
33606 : }
33607 : }
33608 : return 1;
33609 : }
33610 :
33611 : /* MemviewSliceValidateAndInit */
33612 : static int
33613 10054 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
33614 : {
33615 10054 : if (buf->shape[dim] <= 1)
33616 : return 1;
33617 9679 : if (buf->strides) {
33618 9679 : if (spec & __Pyx_MEMVIEW_CONTIG) {
33619 8682 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
33620 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
33621 0 : PyErr_Format(PyExc_ValueError,
33622 : "Buffer is not indirectly contiguous "
33623 : "in dimension %d.", dim);
33624 0 : goto fail;
33625 : }
33626 8682 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
33627 0 : PyErr_SetString(PyExc_ValueError,
33628 : "Buffer and memoryview are not contiguous "
33629 : "in the same dimension.");
33630 0 : goto fail;
33631 : }
33632 : }
33633 9679 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
33634 997 : Py_ssize_t stride = buf->strides[dim];
33635 997 : if (stride < 0)
33636 : stride = -stride;
33637 997 : if (unlikely(stride < buf->itemsize)) {
33638 0 : PyErr_SetString(PyExc_ValueError,
33639 : "Buffer and memoryview are not contiguous "
33640 : "in the same dimension.");
33641 0 : goto fail;
33642 : }
33643 : }
33644 : } else {
33645 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
33646 0 : PyErr_Format(PyExc_ValueError,
33647 : "C-contiguous buffer is not contiguous in "
33648 : "dimension %d", dim);
33649 0 : goto fail;
33650 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
33651 0 : PyErr_Format(PyExc_ValueError,
33652 : "C-contiguous buffer is not indirect in "
33653 : "dimension %d", dim);
33654 0 : goto fail;
33655 0 : } else if (unlikely(buf->suboffsets)) {
33656 0 : PyErr_SetString(PyExc_ValueError,
33657 : "Buffer exposes suboffsets but no strides");
33658 0 : goto fail;
33659 : }
33660 : }
33661 : return 1;
33662 : fail:
33663 : return 0;
33664 : }
33665 : static int
33666 10054 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
33667 : {
33668 10054 : CYTHON_UNUSED_VAR(ndim);
33669 10054 : if (spec & __Pyx_MEMVIEW_DIRECT) {
33670 10054 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
33671 0 : PyErr_Format(PyExc_ValueError,
33672 : "Buffer not compatible with direct access "
33673 : "in dimension %d.", dim);
33674 0 : goto fail;
33675 : }
33676 : }
33677 10054 : if (spec & __Pyx_MEMVIEW_PTR) {
33678 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
33679 0 : PyErr_Format(PyExc_ValueError,
33680 : "Buffer is not indirectly accessible "
33681 : "in dimension %d.", dim);
33682 0 : goto fail;
33683 : }
33684 : }
33685 : return 1;
33686 : fail:
33687 : return 0;
33688 : }
33689 : static int
33690 9057 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
33691 : {
33692 9057 : int i;
33693 9057 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
33694 : Py_ssize_t stride = 1;
33695 0 : for (i = 0; i < ndim; i++) {
33696 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
33697 0 : PyErr_SetString(PyExc_ValueError,
33698 : "Buffer not fortran contiguous.");
33699 0 : goto fail;
33700 : }
33701 0 : stride = stride * buf->shape[i];
33702 : }
33703 9057 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
33704 9057 : Py_ssize_t stride = 1;
33705 19111 : for (i = ndim - 1; i >- 1; i--) {
33706 10054 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
33707 0 : PyErr_SetString(PyExc_ValueError,
33708 : "Buffer not C contiguous.");
33709 0 : goto fail;
33710 : }
33711 10054 : stride = stride * buf->shape[i];
33712 : }
33713 : }
33714 : return 1;
33715 : fail:
33716 : return 0;
33717 : }
33718 10006 : static int __Pyx_ValidateAndInit_memviewslice(
33719 : int *axes_specs,
33720 : int c_or_f_flag,
33721 : int buf_flags,
33722 : int ndim,
33723 : __Pyx_TypeInfo *dtype,
33724 : __Pyx_BufFmt_StackElem stack[],
33725 : __Pyx_memviewslice *memviewslice,
33726 : PyObject *original_obj)
33727 : {
33728 10006 : struct __pyx_memoryview_obj *memview, *new_memview;
33729 : __Pyx_RefNannyDeclarations
33730 10006 : Py_buffer *buf;
33731 10006 : int i, spec = 0, retval = -1;
33732 10006 : __Pyx_BufFmt_Context ctx;
33733 10006 : int from_memoryview = __pyx_memoryview_check(original_obj);
33734 10006 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
33735 10006 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
33736 : original_obj)->typeinfo)) {
33737 : memview = (struct __pyx_memoryview_obj *) original_obj;
33738 : new_memview = NULL;
33739 : } else {
33740 10006 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
33741 : original_obj, buf_flags, 0, dtype);
33742 10006 : new_memview = memview;
33743 10006 : if (unlikely(!memview))
33744 0 : goto fail;
33745 : }
33746 10006 : buf = &memview->view;
33747 10006 : if (unlikely(buf->ndim != ndim)) {
33748 0 : PyErr_Format(PyExc_ValueError,
33749 : "Buffer has wrong number of dimensions (expected %d, got %d)",
33750 : ndim, buf->ndim);
33751 0 : goto fail;
33752 : }
33753 10006 : if (new_memview) {
33754 10006 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
33755 10006 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
33756 : }
33757 10006 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
33758 0 : PyErr_Format(PyExc_ValueError,
33759 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
33760 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
33761 : buf->itemsize,
33762 : (buf->itemsize > 1) ? "s" : "",
33763 : dtype->name,
33764 : dtype->size,
33765 : (dtype->size > 1) ? "s" : "");
33766 0 : goto fail;
33767 : }
33768 10006 : if (buf->len > 0) {
33769 19111 : for (i = 0; i < ndim; i++) {
33770 10054 : spec = axes_specs[i];
33771 10054 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
33772 0 : goto fail;
33773 10054 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
33774 0 : goto fail;
33775 : }
33776 9057 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
33777 0 : goto fail;
33778 : }
33779 10006 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
33780 : new_memview != NULL) == -1)) {
33781 0 : goto fail;
33782 : }
33783 10006 : retval = 0;
33784 10006 : goto no_fail;
33785 0 : fail:
33786 0 : Py_XDECREF(new_memview);
33787 : retval = -1;
33788 10006 : no_fail:
33789 10006 : __Pyx_RefNannyFinishContext();
33790 10006 : return retval;
33791 : }
33792 :
33793 : /* ObjectToMemviewSlice */
33794 6006 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) {
33795 6006 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33796 6006 : __Pyx_BufFmt_StackElem stack[1];
33797 6006 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
33798 6006 : int retcode;
33799 6006 : if (obj == Py_None) {
33800 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
33801 0 : return result;
33802 : }
33803 6006 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
33804 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
33805 : &__Pyx_TypeInfo_double, stack,
33806 : &result, obj);
33807 6006 : if (unlikely(retcode == -1))
33808 0 : goto __pyx_fail;
33809 : return result;
33810 0 : __pyx_fail:
33811 0 : result.memview = NULL;
33812 0 : result.data = NULL;
33813 0 : return result;
33814 : }
33815 :
33816 : /* ObjectToMemviewSlice */
33817 2002 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *obj, int writable_flag) {
33818 2002 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33819 2002 : __Pyx_BufFmt_StackElem stack[1];
33820 2002 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
33821 2002 : int retcode;
33822 2002 : if (obj == Py_None) {
33823 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
33824 0 : return result;
33825 : }
33826 2002 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
33827 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
33828 : &__Pyx_TypeInfo_int, stack,
33829 : &result, obj);
33830 2002 : if (unlikely(retcode == -1))
33831 0 : goto __pyx_fail;
33832 : return result;
33833 0 : __pyx_fail:
33834 0 : result.memview = NULL;
33835 0 : result.data = NULL;
33836 0 : return result;
33837 : }
33838 :
33839 : /* ObjectToMemviewSlice */
33840 1001 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *obj, int writable_flag) {
33841 1001 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33842 1001 : __Pyx_BufFmt_StackElem stack[1];
33843 1001 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
33844 1001 : int retcode;
33845 1001 : if (obj == Py_None) {
33846 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
33847 0 : return result;
33848 : }
33849 1001 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
33850 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
33851 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
33852 : &result, obj);
33853 1001 : if (unlikely(retcode == -1))
33854 0 : goto __pyx_fail;
33855 : return result;
33856 0 : __pyx_fail:
33857 0 : result.memview = NULL;
33858 0 : result.data = NULL;
33859 0 : return result;
33860 : }
33861 :
33862 : /* CIntFromPyVerify */
33863 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
33864 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
33865 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
33866 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
33867 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
33868 : {\
33869 : func_type value = func_value;\
33870 : if (sizeof(target_type) < sizeof(func_type)) {\
33871 : if (unlikely(value != (func_type) (target_type) value)) {\
33872 : func_type zero = 0;\
33873 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
33874 : return (target_type) -1;\
33875 : if (is_unsigned && unlikely(value < zero))\
33876 : goto raise_neg_overflow;\
33877 : else\
33878 : goto raise_overflow;\
33879 : }\
33880 : }\
33881 : return (target_type) value;\
33882 : }
33883 :
33884 : /* MemviewDtypeToObject */
33885 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
33886 0 : return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
33887 : }
33888 0 : static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
33889 0 : double value = __pyx_PyFloat_AsDouble(obj);
33890 0 : if (unlikely((value == (double)-1) && PyErr_Occurred()))
33891 : return 0;
33892 0 : *(double *) itemp = value;
33893 0 : return 1;
33894 : }
33895 :
33896 : /* MemviewDtypeToObject */
33897 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) {
33898 0 : return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp);
33899 : }
33900 0 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) {
33901 0 : __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj);
33902 0 : if (unlikely((value == ((npy_uint8)-1)) && PyErr_Occurred()))
33903 : return 0;
33904 0 : *(__pyx_t_5numpy_uint8_t *) itemp = value;
33905 0 : return 1;
33906 : }
33907 :
33908 : /* ObjectToMemviewSlice */
33909 997 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
33910 997 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33911 997 : __Pyx_BufFmt_StackElem stack[1];
33912 997 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
33913 997 : int retcode;
33914 997 : if (obj == Py_None) {
33915 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
33916 0 : return result;
33917 : }
33918 997 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
33919 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
33920 : &__Pyx_TypeInfo_double, stack,
33921 : &result, obj);
33922 997 : if (unlikely(retcode == -1))
33923 0 : goto __pyx_fail;
33924 : return result;
33925 0 : __pyx_fail:
33926 0 : result.memview = NULL;
33927 0 : result.data = NULL;
33928 0 : return result;
33929 : }
33930 :
33931 : /* Declarations */
33932 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33933 : #ifdef __cplusplus
33934 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33935 : return ::std::complex< float >(x, y);
33936 : }
33937 : #else
33938 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33939 : return x + y*(__pyx_t_float_complex)_Complex_I;
33940 : }
33941 : #endif
33942 : #else
33943 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33944 : __pyx_t_float_complex z;
33945 : z.real = x;
33946 : z.imag = y;
33947 : return z;
33948 : }
33949 : #endif
33950 :
33951 : /* Arithmetic */
33952 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33953 : #else
33954 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33955 : return (a.real == b.real) && (a.imag == b.imag);
33956 : }
33957 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33958 : __pyx_t_float_complex z;
33959 : z.real = a.real + b.real;
33960 : z.imag = a.imag + b.imag;
33961 : return z;
33962 : }
33963 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33964 : __pyx_t_float_complex z;
33965 : z.real = a.real - b.real;
33966 : z.imag = a.imag - b.imag;
33967 : return z;
33968 : }
33969 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33970 : __pyx_t_float_complex z;
33971 : z.real = a.real * b.real - a.imag * b.imag;
33972 : z.imag = a.real * b.imag + a.imag * b.real;
33973 : return z;
33974 : }
33975 : #if 1
33976 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33977 : if (b.imag == 0) {
33978 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
33979 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
33980 : if (b.real == 0 && b.imag == 0) {
33981 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
33982 : } else {
33983 : float r = b.imag / b.real;
33984 : float s = (float)(1.0) / (b.real + b.imag * r);
33985 : return __pyx_t_float_complex_from_parts(
33986 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
33987 : }
33988 : } else {
33989 : float r = b.real / b.imag;
33990 : float s = (float)(1.0) / (b.imag + b.real * r);
33991 : return __pyx_t_float_complex_from_parts(
33992 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
33993 : }
33994 : }
33995 : #else
33996 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33997 : if (b.imag == 0) {
33998 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
33999 : } else {
34000 : float denom = b.real * b.real + b.imag * b.imag;
34001 : return __pyx_t_float_complex_from_parts(
34002 : (a.real * b.real + a.imag * b.imag) / denom,
34003 : (a.imag * b.real - a.real * b.imag) / denom);
34004 : }
34005 : }
34006 : #endif
34007 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
34008 : __pyx_t_float_complex z;
34009 : z.real = -a.real;
34010 : z.imag = -a.imag;
34011 : return z;
34012 : }
34013 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
34014 : return (a.real == 0) && (a.imag == 0);
34015 : }
34016 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
34017 : __pyx_t_float_complex z;
34018 : z.real = a.real;
34019 : z.imag = -a.imag;
34020 : return z;
34021 : }
34022 : #if 1
34023 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
34024 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34025 : return sqrtf(z.real*z.real + z.imag*z.imag);
34026 : #else
34027 : return hypotf(z.real, z.imag);
34028 : #endif
34029 : }
34030 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34031 : __pyx_t_float_complex z;
34032 : float r, lnr, theta, z_r, z_theta;
34033 : if (b.imag == 0 && b.real == (int)b.real) {
34034 : if (b.real < 0) {
34035 : float denom = a.real * a.real + a.imag * a.imag;
34036 : a.real = a.real / denom;
34037 : a.imag = -a.imag / denom;
34038 : b.real = -b.real;
34039 : }
34040 : switch ((int)b.real) {
34041 : case 0:
34042 : z.real = 1;
34043 : z.imag = 0;
34044 : return z;
34045 : case 1:
34046 : return a;
34047 : case 2:
34048 : return __Pyx_c_prod_float(a, a);
34049 : case 3:
34050 : z = __Pyx_c_prod_float(a, a);
34051 : return __Pyx_c_prod_float(z, a);
34052 : case 4:
34053 : z = __Pyx_c_prod_float(a, a);
34054 : return __Pyx_c_prod_float(z, z);
34055 : }
34056 : }
34057 : if (a.imag == 0) {
34058 : if (a.real == 0) {
34059 : return a;
34060 : } else if ((b.imag == 0) && (a.real >= 0)) {
34061 : z.real = powf(a.real, b.real);
34062 : z.imag = 0;
34063 : return z;
34064 : } else if (a.real > 0) {
34065 : r = a.real;
34066 : theta = 0;
34067 : } else {
34068 : r = -a.real;
34069 : theta = atan2f(0.0, -1.0);
34070 : }
34071 : } else {
34072 : r = __Pyx_c_abs_float(a);
34073 : theta = atan2f(a.imag, a.real);
34074 : }
34075 : lnr = logf(r);
34076 : z_r = expf(lnr * b.real - theta * b.imag);
34077 : z_theta = theta * b.real + lnr * b.imag;
34078 : z.real = z_r * cosf(z_theta);
34079 : z.imag = z_r * sinf(z_theta);
34080 : return z;
34081 : }
34082 : #endif
34083 : #endif
34084 :
34085 : /* Declarations */
34086 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34087 : #ifdef __cplusplus
34088 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34089 : return ::std::complex< double >(x, y);
34090 : }
34091 : #else
34092 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34093 : return x + y*(__pyx_t_double_complex)_Complex_I;
34094 : }
34095 : #endif
34096 : #else
34097 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34098 : __pyx_t_double_complex z;
34099 : z.real = x;
34100 : z.imag = y;
34101 : return z;
34102 : }
34103 : #endif
34104 :
34105 : /* Arithmetic */
34106 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34107 : #else
34108 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34109 : return (a.real == b.real) && (a.imag == b.imag);
34110 : }
34111 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34112 : __pyx_t_double_complex z;
34113 : z.real = a.real + b.real;
34114 : z.imag = a.imag + b.imag;
34115 : return z;
34116 : }
34117 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34118 : __pyx_t_double_complex z;
34119 : z.real = a.real - b.real;
34120 : z.imag = a.imag - b.imag;
34121 : return z;
34122 : }
34123 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34124 : __pyx_t_double_complex z;
34125 : z.real = a.real * b.real - a.imag * b.imag;
34126 : z.imag = a.real * b.imag + a.imag * b.real;
34127 : return z;
34128 : }
34129 : #if 1
34130 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34131 : if (b.imag == 0) {
34132 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34133 : } else if (fabs(b.real) >= fabs(b.imag)) {
34134 : if (b.real == 0 && b.imag == 0) {
34135 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34136 : } else {
34137 : double r = b.imag / b.real;
34138 : double s = (double)(1.0) / (b.real + b.imag * r);
34139 : return __pyx_t_double_complex_from_parts(
34140 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34141 : }
34142 : } else {
34143 : double r = b.real / b.imag;
34144 : double s = (double)(1.0) / (b.imag + b.real * r);
34145 : return __pyx_t_double_complex_from_parts(
34146 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34147 : }
34148 : }
34149 : #else
34150 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34151 : if (b.imag == 0) {
34152 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34153 : } else {
34154 : double denom = b.real * b.real + b.imag * b.imag;
34155 : return __pyx_t_double_complex_from_parts(
34156 : (a.real * b.real + a.imag * b.imag) / denom,
34157 : (a.imag * b.real - a.real * b.imag) / denom);
34158 : }
34159 : }
34160 : #endif
34161 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
34162 : __pyx_t_double_complex z;
34163 : z.real = -a.real;
34164 : z.imag = -a.imag;
34165 : return z;
34166 : }
34167 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
34168 : return (a.real == 0) && (a.imag == 0);
34169 : }
34170 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
34171 : __pyx_t_double_complex z;
34172 : z.real = a.real;
34173 : z.imag = -a.imag;
34174 : return z;
34175 : }
34176 : #if 1
34177 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
34178 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34179 : return sqrt(z.real*z.real + z.imag*z.imag);
34180 : #else
34181 : return hypot(z.real, z.imag);
34182 : #endif
34183 : }
34184 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34185 : __pyx_t_double_complex z;
34186 : double r, lnr, theta, z_r, z_theta;
34187 : if (b.imag == 0 && b.real == (int)b.real) {
34188 : if (b.real < 0) {
34189 : double denom = a.real * a.real + a.imag * a.imag;
34190 : a.real = a.real / denom;
34191 : a.imag = -a.imag / denom;
34192 : b.real = -b.real;
34193 : }
34194 : switch ((int)b.real) {
34195 : case 0:
34196 : z.real = 1;
34197 : z.imag = 0;
34198 : return z;
34199 : case 1:
34200 : return a;
34201 : case 2:
34202 : return __Pyx_c_prod_double(a, a);
34203 : case 3:
34204 : z = __Pyx_c_prod_double(a, a);
34205 : return __Pyx_c_prod_double(z, a);
34206 : case 4:
34207 : z = __Pyx_c_prod_double(a, a);
34208 : return __Pyx_c_prod_double(z, z);
34209 : }
34210 : }
34211 : if (a.imag == 0) {
34212 : if (a.real == 0) {
34213 : return a;
34214 : } else if ((b.imag == 0) && (a.real >= 0)) {
34215 : z.real = pow(a.real, b.real);
34216 : z.imag = 0;
34217 : return z;
34218 : } else if (a.real > 0) {
34219 : r = a.real;
34220 : theta = 0;
34221 : } else {
34222 : r = -a.real;
34223 : theta = atan2(0.0, -1.0);
34224 : }
34225 : } else {
34226 : r = __Pyx_c_abs_double(a);
34227 : theta = atan2(a.imag, a.real);
34228 : }
34229 : lnr = log(r);
34230 : z_r = exp(lnr * b.real - theta * b.imag);
34231 : z_theta = theta * b.real + lnr * b.imag;
34232 : z.real = z_r * cos(z_theta);
34233 : z.imag = z_r * sin(z_theta);
34234 : return z;
34235 : }
34236 : #endif
34237 : #endif
34238 :
34239 : /* Declarations */
34240 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34241 : #ifdef __cplusplus
34242 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34243 : return ::std::complex< long double >(x, y);
34244 : }
34245 : #else
34246 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34247 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
34248 : }
34249 : #endif
34250 : #else
34251 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34252 : __pyx_t_long_double_complex z;
34253 : z.real = x;
34254 : z.imag = y;
34255 : return z;
34256 : }
34257 : #endif
34258 :
34259 : /* Arithmetic */
34260 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34261 : #else
34262 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34263 : return (a.real == b.real) && (a.imag == b.imag);
34264 : }
34265 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34266 : __pyx_t_long_double_complex z;
34267 : z.real = a.real + b.real;
34268 : z.imag = a.imag + b.imag;
34269 : return z;
34270 : }
34271 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34272 : __pyx_t_long_double_complex z;
34273 : z.real = a.real - b.real;
34274 : z.imag = a.imag - b.imag;
34275 : return z;
34276 : }
34277 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34278 : __pyx_t_long_double_complex z;
34279 : z.real = a.real * b.real - a.imag * b.imag;
34280 : z.imag = a.real * b.imag + a.imag * b.real;
34281 : return z;
34282 : }
34283 : #if 1
34284 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34285 : if (b.imag == 0) {
34286 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34287 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
34288 : if (b.real == 0 && b.imag == 0) {
34289 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34290 : } else {
34291 : long double r = b.imag / b.real;
34292 : long double s = (long double)(1.0) / (b.real + b.imag * r);
34293 : return __pyx_t_long_double_complex_from_parts(
34294 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34295 : }
34296 : } else {
34297 : long double r = b.real / b.imag;
34298 : long double s = (long double)(1.0) / (b.imag + b.real * r);
34299 : return __pyx_t_long_double_complex_from_parts(
34300 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34301 : }
34302 : }
34303 : #else
34304 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34305 : if (b.imag == 0) {
34306 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34307 : } else {
34308 : long double denom = b.real * b.real + b.imag * b.imag;
34309 : return __pyx_t_long_double_complex_from_parts(
34310 : (a.real * b.real + a.imag * b.imag) / denom,
34311 : (a.imag * b.real - a.real * b.imag) / denom);
34312 : }
34313 : }
34314 : #endif
34315 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
34316 : __pyx_t_long_double_complex z;
34317 : z.real = -a.real;
34318 : z.imag = -a.imag;
34319 : return z;
34320 : }
34321 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
34322 : return (a.real == 0) && (a.imag == 0);
34323 : }
34324 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
34325 : __pyx_t_long_double_complex z;
34326 : z.real = a.real;
34327 : z.imag = -a.imag;
34328 : return z;
34329 : }
34330 : #if 1
34331 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
34332 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34333 : return sqrtl(z.real*z.real + z.imag*z.imag);
34334 : #else
34335 : return hypotl(z.real, z.imag);
34336 : #endif
34337 : }
34338 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34339 : __pyx_t_long_double_complex z;
34340 : long double r, lnr, theta, z_r, z_theta;
34341 : if (b.imag == 0 && b.real == (int)b.real) {
34342 : if (b.real < 0) {
34343 : long double denom = a.real * a.real + a.imag * a.imag;
34344 : a.real = a.real / denom;
34345 : a.imag = -a.imag / denom;
34346 : b.real = -b.real;
34347 : }
34348 : switch ((int)b.real) {
34349 : case 0:
34350 : z.real = 1;
34351 : z.imag = 0;
34352 : return z;
34353 : case 1:
34354 : return a;
34355 : case 2:
34356 : return __Pyx_c_prod_long__double(a, a);
34357 : case 3:
34358 : z = __Pyx_c_prod_long__double(a, a);
34359 : return __Pyx_c_prod_long__double(z, a);
34360 : case 4:
34361 : z = __Pyx_c_prod_long__double(a, a);
34362 : return __Pyx_c_prod_long__double(z, z);
34363 : }
34364 : }
34365 : if (a.imag == 0) {
34366 : if (a.real == 0) {
34367 : return a;
34368 : } else if ((b.imag == 0) && (a.real >= 0)) {
34369 : z.real = powl(a.real, b.real);
34370 : z.imag = 0;
34371 : return z;
34372 : } else if (a.real > 0) {
34373 : r = a.real;
34374 : theta = 0;
34375 : } else {
34376 : r = -a.real;
34377 : theta = atan2l(0.0, -1.0);
34378 : }
34379 : } else {
34380 : r = __Pyx_c_abs_long__double(a);
34381 : theta = atan2l(a.imag, a.real);
34382 : }
34383 : lnr = logl(r);
34384 : z_r = expl(lnr * b.real - theta * b.imag);
34385 : z_theta = theta * b.real + lnr * b.imag;
34386 : z.real = z_r * cosl(z_theta);
34387 : z.imag = z_r * sinl(z_theta);
34388 : return z;
34389 : }
34390 : #endif
34391 : #endif
34392 :
34393 : /* MemviewSliceCopyTemplate */
34394 : static __Pyx_memviewslice
34395 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
34396 : const char *mode, int ndim,
34397 : size_t sizeof_dtype, int contig_flag,
34398 : int dtype_is_object)
34399 : {
34400 : __Pyx_RefNannyDeclarations
34401 0 : int i;
34402 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
34403 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
34404 0 : Py_buffer *buf = &from_memview->view;
34405 0 : PyObject *shape_tuple = NULL;
34406 0 : PyObject *temp_int = NULL;
34407 0 : struct __pyx_array_obj *array_obj = NULL;
34408 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
34409 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
34410 0 : for (i = 0; i < ndim; i++) {
34411 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
34412 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
34413 : "indirect dimensions (axis %d)", i);
34414 0 : goto fail;
34415 : }
34416 : }
34417 0 : shape_tuple = PyTuple_New(ndim);
34418 0 : if (unlikely(!shape_tuple)) {
34419 0 : goto fail;
34420 : }
34421 : __Pyx_GOTREF(shape_tuple);
34422 0 : for(i = 0; i < ndim; i++) {
34423 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
34424 0 : if(unlikely(!temp_int)) {
34425 0 : goto fail;
34426 : } else {
34427 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
34428 0 : temp_int = NULL;
34429 : }
34430 : }
34431 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
34432 0 : if (unlikely(!array_obj)) {
34433 0 : goto fail;
34434 : }
34435 0 : __Pyx_GOTREF(array_obj);
34436 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
34437 : (PyObject *) array_obj, contig_flag,
34438 : dtype_is_object,
34439 0 : from_mvs->memview->typeinfo);
34440 0 : if (unlikely(!memview_obj))
34441 0 : goto fail;
34442 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
34443 0 : goto fail;
34444 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
34445 : dtype_is_object) < 0))
34446 0 : goto fail;
34447 0 : goto no_fail;
34448 0 : fail:
34449 0 : __Pyx_XDECREF(new_mvs.memview);
34450 0 : new_mvs.memview = NULL;
34451 0 : new_mvs.data = NULL;
34452 0 : no_fail:
34453 0 : __Pyx_XDECREF(shape_tuple);
34454 0 : __Pyx_XDECREF(temp_int);
34455 0 : __Pyx_XDECREF(array_obj);
34456 0 : __Pyx_RefNannyFinishContext();
34457 0 : return new_mvs;
34458 : }
34459 :
34460 : /* MemviewSliceInit */
34461 : static int
34462 10006 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
34463 : int ndim,
34464 : __Pyx_memviewslice *memviewslice,
34465 : int memview_is_new_reference)
34466 : {
34467 : __Pyx_RefNannyDeclarations
34468 10006 : int i, retval=-1;
34469 10006 : Py_buffer *buf = &memview->view;
34470 10006 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
34471 10006 : if (unlikely(memviewslice->memview || memviewslice->data)) {
34472 0 : PyErr_SetString(PyExc_ValueError,
34473 : "memviewslice is already initialized!");
34474 0 : goto fail;
34475 : }
34476 10006 : if (buf->strides) {
34477 21009 : for (i = 0; i < ndim; i++) {
34478 11003 : memviewslice->strides[i] = buf->strides[i];
34479 : }
34480 : } else {
34481 0 : Py_ssize_t stride = buf->itemsize;
34482 0 : for (i = ndim - 1; i >= 0; i--) {
34483 0 : memviewslice->strides[i] = stride;
34484 0 : stride *= buf->shape[i];
34485 : }
34486 : }
34487 21009 : for (i = 0; i < ndim; i++) {
34488 11003 : memviewslice->shape[i] = buf->shape[i];
34489 11003 : if (buf->suboffsets) {
34490 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
34491 : } else {
34492 11003 : memviewslice->suboffsets[i] = -1;
34493 : }
34494 : }
34495 10006 : memviewslice->memview = memview;
34496 10006 : memviewslice->data = (char *)buf->buf;
34497 10006 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
34498 0 : Py_INCREF(memview);
34499 : }
34500 10006 : retval = 0;
34501 10006 : goto no_fail;
34502 0 : fail:
34503 0 : memviewslice->memview = 0;
34504 0 : memviewslice->data = 0;
34505 0 : retval = -1;
34506 10006 : no_fail:
34507 10006 : __Pyx_RefNannyFinishContext();
34508 10006 : return retval;
34509 : }
34510 : #ifndef Py_NO_RETURN
34511 : #define Py_NO_RETURN
34512 : #endif
34513 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
34514 0 : va_list vargs;
34515 0 : char msg[200];
34516 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
34517 0 : va_start(vargs, fmt);
34518 : #else
34519 : va_start(vargs);
34520 : #endif
34521 0 : vsnprintf(msg, 200, fmt, vargs);
34522 0 : va_end(vargs);
34523 0 : Py_FatalError(msg);
34524 : }
34525 : static CYTHON_INLINE int
34526 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
34527 : PyThread_type_lock lock)
34528 : {
34529 : int result;
34530 : PyThread_acquire_lock(lock, 1);
34531 : result = (*acquisition_count)++;
34532 : PyThread_release_lock(lock);
34533 : return result;
34534 : }
34535 : static CYTHON_INLINE int
34536 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
34537 : PyThread_type_lock lock)
34538 : {
34539 : int result;
34540 : PyThread_acquire_lock(lock, 1);
34541 : result = (*acquisition_count)--;
34542 : PyThread_release_lock(lock);
34543 : return result;
34544 : }
34545 : static CYTHON_INLINE void
34546 6345 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
34547 : {
34548 6345 : __pyx_nonatomic_int_type old_acquisition_count;
34549 6345 : struct __pyx_memoryview_obj *memview = memslice->memview;
34550 6345 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
34551 : return;
34552 : }
34553 6345 : old_acquisition_count = __pyx_add_acquisition_count(memview);
34554 6345 : if (unlikely(old_acquisition_count <= 0)) {
34555 0 : if (likely(old_acquisition_count == 0)) {
34556 0 : if (have_gil) {
34557 0 : Py_INCREF((PyObject *) memview);
34558 : } else {
34559 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
34560 0 : Py_INCREF((PyObject *) memview);
34561 0 : PyGILState_Release(_gilstate);
34562 : }
34563 : } else {
34564 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
34565 : old_acquisition_count+1, lineno);
34566 : }
34567 : }
34568 : }
34569 16355 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
34570 : int have_gil, int lineno) {
34571 16355 : __pyx_nonatomic_int_type old_acquisition_count;
34572 16355 : struct __pyx_memoryview_obj *memview = memslice->memview;
34573 16355 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
34574 4 : memslice->memview = NULL;
34575 4 : return;
34576 : }
34577 16351 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
34578 16351 : memslice->data = NULL;
34579 16351 : if (likely(old_acquisition_count > 1)) {
34580 6345 : memslice->memview = NULL;
34581 10006 : } else if (likely(old_acquisition_count == 1)) {
34582 10006 : if (have_gil) {
34583 10006 : Py_CLEAR(memslice->memview);
34584 : } else {
34585 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
34586 0 : Py_CLEAR(memslice->memview);
34587 0 : PyGILState_Release(_gilstate);
34588 : }
34589 : } else {
34590 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
34591 : old_acquisition_count-1, lineno);
34592 : }
34593 : }
34594 :
34595 : /* CIntToPy */
34596 15026 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
34597 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34598 15026 : #pragma GCC diagnostic push
34599 15026 : #pragma GCC diagnostic ignored "-Wconversion"
34600 : #endif
34601 15026 : const int neg_one = (int) -1, const_zero = (int) 0;
34602 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34603 15026 : #pragma GCC diagnostic pop
34604 : #endif
34605 15026 : const int is_unsigned = neg_one > const_zero;
34606 15026 : if (is_unsigned) {
34607 : if (sizeof(int) < sizeof(long)) {
34608 : return PyInt_FromLong((long) value);
34609 : } else if (sizeof(int) <= sizeof(unsigned long)) {
34610 : return PyLong_FromUnsignedLong((unsigned long) value);
34611 : #ifdef HAVE_LONG_LONG
34612 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
34613 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34614 : #endif
34615 : }
34616 : } else {
34617 15026 : if (sizeof(int) <= sizeof(long)) {
34618 15026 : return PyInt_FromLong((long) value);
34619 : #ifdef HAVE_LONG_LONG
34620 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
34621 : return PyLong_FromLongLong((PY_LONG_LONG) value);
34622 : #endif
34623 : }
34624 : }
34625 : {
34626 : unsigned char *bytes = (unsigned char *)&value;
34627 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
34628 : if (is_unsigned) {
34629 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
34630 : } else {
34631 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
34632 : }
34633 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
34634 : int one = 1; int little = (int)*(unsigned char *)&one;
34635 : return _PyLong_FromByteArray(bytes, sizeof(int),
34636 : little, !is_unsigned);
34637 : #else
34638 : int one = 1; int little = (int)*(unsigned char *)&one;
34639 : PyObject *from_bytes, *result = NULL;
34640 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
34641 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
34642 : if (!from_bytes) return NULL;
34643 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
34644 : if (!py_bytes) goto limited_bad;
34645 : order_str = PyUnicode_FromString(little ? "little" : "big");
34646 : if (!order_str) goto limited_bad;
34647 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
34648 : if (!arg_tuple) goto limited_bad;
34649 : if (!is_unsigned) {
34650 : kwds = PyDict_New();
34651 : if (!kwds) goto limited_bad;
34652 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
34653 : }
34654 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
34655 : limited_bad:
34656 : Py_XDECREF(kwds);
34657 : Py_XDECREF(arg_tuple);
34658 : Py_XDECREF(order_str);
34659 : Py_XDECREF(py_bytes);
34660 : Py_XDECREF(from_bytes);
34661 : return result;
34662 : #endif
34663 : }
34664 : }
34665 :
34666 : /* CIntFromPy */
34667 22628 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
34668 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34669 22628 : #pragma GCC diagnostic push
34670 22628 : #pragma GCC diagnostic ignored "-Wconversion"
34671 : #endif
34672 22628 : const int neg_one = (int) -1, const_zero = (int) 0;
34673 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34674 22628 : #pragma GCC diagnostic pop
34675 : #endif
34676 22628 : const int is_unsigned = neg_one > const_zero;
34677 : #if PY_MAJOR_VERSION < 3
34678 : if (likely(PyInt_Check(x))) {
34679 : if ((sizeof(int) < sizeof(long))) {
34680 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
34681 : } else {
34682 : long val = PyInt_AS_LONG(x);
34683 : if (is_unsigned && unlikely(val < 0)) {
34684 : goto raise_neg_overflow;
34685 : }
34686 : return (int) val;
34687 : }
34688 : }
34689 : #endif
34690 22628 : if (unlikely(!PyLong_Check(x))) {
34691 0 : int val;
34692 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34693 0 : if (!tmp) return (int) -1;
34694 0 : val = __Pyx_PyInt_As_int(tmp);
34695 0 : Py_DECREF(tmp);
34696 0 : return val;
34697 : }
34698 22628 : if (is_unsigned) {
34699 : #if CYTHON_USE_PYLONG_INTERNALS
34700 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
34701 : goto raise_neg_overflow;
34702 : } else if (__Pyx_PyLong_IsCompact(x)) {
34703 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
34704 : } else {
34705 : const digit* digits = __Pyx_PyLong_Digits(x);
34706 : assert(__Pyx_PyLong_DigitCount(x) > 1);
34707 : switch (__Pyx_PyLong_DigitCount(x)) {
34708 : case 2:
34709 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
34710 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34711 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34712 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
34713 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
34714 : }
34715 : }
34716 : break;
34717 : case 3:
34718 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
34719 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34720 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34721 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
34722 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
34723 : }
34724 : }
34725 : break;
34726 : case 4:
34727 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
34728 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34729 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34730 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
34731 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
34732 : }
34733 : }
34734 : break;
34735 : }
34736 : }
34737 : #endif
34738 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
34739 : if (unlikely(Py_SIZE(x) < 0)) {
34740 : goto raise_neg_overflow;
34741 : }
34742 : #else
34743 : {
34744 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34745 : if (unlikely(result < 0))
34746 : return (int) -1;
34747 : if (unlikely(result == 1))
34748 : goto raise_neg_overflow;
34749 : }
34750 : #endif
34751 : if ((sizeof(int) <= sizeof(unsigned long))) {
34752 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
34753 : #ifdef HAVE_LONG_LONG
34754 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
34755 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34756 : #endif
34757 : }
34758 : } else {
34759 : #if CYTHON_USE_PYLONG_INTERNALS
34760 22628 : if (__Pyx_PyLong_IsCompact(x)) {
34761 22628 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
34762 : } else {
34763 0 : const digit* digits = __Pyx_PyLong_Digits(x);
34764 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
34765 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
34766 0 : case -2:
34767 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
34768 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34769 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34770 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
34771 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
34772 : }
34773 : }
34774 : break;
34775 0 : case 2:
34776 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
34777 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34778 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34779 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
34780 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
34781 : }
34782 : }
34783 : break;
34784 : case -3:
34785 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
34786 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34787 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34788 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
34789 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
34790 : }
34791 : }
34792 : break;
34793 : case 3:
34794 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
34795 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34796 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34797 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
34798 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
34799 : }
34800 : }
34801 : break;
34802 : case -4:
34803 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
34804 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34805 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34806 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
34807 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
34808 : }
34809 : }
34810 : break;
34811 : case 4:
34812 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
34813 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34814 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34815 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
34816 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
34817 : }
34818 : }
34819 : break;
34820 : }
34821 : }
34822 : #endif
34823 0 : if ((sizeof(int) <= sizeof(long))) {
34824 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
34825 : #ifdef HAVE_LONG_LONG
34826 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
34827 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
34828 : #endif
34829 : }
34830 : }
34831 : {
34832 : int val;
34833 : int ret = -1;
34834 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
34835 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
34836 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
34837 : if (unlikely(bytes_copied == -1)) {
34838 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
34839 : goto raise_overflow;
34840 : } else {
34841 : ret = 0;
34842 : }
34843 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
34844 : int one = 1; int is_little = (int)*(unsigned char *)&one;
34845 : unsigned char *bytes = (unsigned char *)&val;
34846 : ret = _PyLong_AsByteArray((PyLongObject *)x,
34847 : bytes, sizeof(val),
34848 : is_little, !is_unsigned);
34849 : #else
34850 : PyObject *v;
34851 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
34852 : int bits, remaining_bits, is_negative = 0;
34853 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
34854 : if (likely(PyLong_CheckExact(x))) {
34855 : v = __Pyx_NewRef(x);
34856 : } else {
34857 : v = PyNumber_Long(x);
34858 : if (unlikely(!v)) return (int) -1;
34859 : assert(PyLong_CheckExact(v));
34860 : }
34861 : {
34862 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
34863 : if (unlikely(result < 0)) {
34864 : Py_DECREF(v);
34865 : return (int) -1;
34866 : }
34867 : is_negative = result == 1;
34868 : }
34869 : if (is_unsigned && unlikely(is_negative)) {
34870 : Py_DECREF(v);
34871 : goto raise_neg_overflow;
34872 : } else if (is_negative) {
34873 : stepval = PyNumber_Invert(v);
34874 : Py_DECREF(v);
34875 : if (unlikely(!stepval))
34876 : return (int) -1;
34877 : } else {
34878 : stepval = v;
34879 : }
34880 : v = NULL;
34881 : val = (int) 0;
34882 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
34883 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
34884 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
34885 : PyObject *tmp, *digit;
34886 : long idigit;
34887 : digit = PyNumber_And(stepval, mask);
34888 : if (unlikely(!digit)) goto done;
34889 : idigit = PyLong_AsLong(digit);
34890 : Py_DECREF(digit);
34891 : if (unlikely(idigit < 0)) goto done;
34892 : val |= ((int) idigit) << bits;
34893 : tmp = PyNumber_Rshift(stepval, shift);
34894 : if (unlikely(!tmp)) goto done;
34895 : Py_DECREF(stepval); stepval = tmp;
34896 : }
34897 : Py_DECREF(shift); shift = NULL;
34898 : Py_DECREF(mask); mask = NULL;
34899 : {
34900 : long idigit = PyLong_AsLong(stepval);
34901 : if (unlikely(idigit < 0)) goto done;
34902 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
34903 : if (unlikely(idigit >= (1L << remaining_bits)))
34904 : goto raise_overflow;
34905 : val |= ((int) idigit) << bits;
34906 : }
34907 : if (!is_unsigned) {
34908 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
34909 : goto raise_overflow;
34910 : if (is_negative)
34911 : val = ~val;
34912 : }
34913 : ret = 0;
34914 : done:
34915 : Py_XDECREF(shift);
34916 : Py_XDECREF(mask);
34917 : Py_XDECREF(stepval);
34918 : #endif
34919 : if (unlikely(ret))
34920 : return (int) -1;
34921 : return val;
34922 : }
34923 0 : raise_overflow:
34924 0 : PyErr_SetString(PyExc_OverflowError,
34925 : "value too large to convert to int");
34926 0 : return (int) -1;
34927 : raise_neg_overflow:
34928 : PyErr_SetString(PyExc_OverflowError,
34929 : "can't convert negative value to int");
34930 : return (int) -1;
34931 : }
34932 :
34933 : /* CIntToPy */
34934 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) {
34935 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34936 0 : #pragma GCC diagnostic push
34937 0 : #pragma GCC diagnostic ignored "-Wconversion"
34938 : #endif
34939 0 : const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0;
34940 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34941 0 : #pragma GCC diagnostic pop
34942 : #endif
34943 0 : const int is_unsigned = neg_one > const_zero;
34944 0 : if (is_unsigned) {
34945 0 : if (sizeof(npy_uint8) < sizeof(long)) {
34946 0 : return PyInt_FromLong((long) value);
34947 : } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
34948 : return PyLong_FromUnsignedLong((unsigned long) value);
34949 : #ifdef HAVE_LONG_LONG
34950 : } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) {
34951 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34952 : #endif
34953 : }
34954 : } else {
34955 : if (sizeof(npy_uint8) <= sizeof(long)) {
34956 : return PyInt_FromLong((long) value);
34957 : #ifdef HAVE_LONG_LONG
34958 : } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) {
34959 : return PyLong_FromLongLong((PY_LONG_LONG) value);
34960 : #endif
34961 : }
34962 : }
34963 : {
34964 : unsigned char *bytes = (unsigned char *)&value;
34965 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
34966 : if (is_unsigned) {
34967 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
34968 : } else {
34969 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
34970 : }
34971 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
34972 : int one = 1; int little = (int)*(unsigned char *)&one;
34973 : return _PyLong_FromByteArray(bytes, sizeof(npy_uint8),
34974 : little, !is_unsigned);
34975 : #else
34976 : int one = 1; int little = (int)*(unsigned char *)&one;
34977 : PyObject *from_bytes, *result = NULL;
34978 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
34979 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
34980 : if (!from_bytes) return NULL;
34981 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_uint8));
34982 : if (!py_bytes) goto limited_bad;
34983 : order_str = PyUnicode_FromString(little ? "little" : "big");
34984 : if (!order_str) goto limited_bad;
34985 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
34986 : if (!arg_tuple) goto limited_bad;
34987 : if (!is_unsigned) {
34988 : kwds = PyDict_New();
34989 : if (!kwds) goto limited_bad;
34990 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
34991 : }
34992 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
34993 : limited_bad:
34994 : Py_XDECREF(kwds);
34995 : Py_XDECREF(arg_tuple);
34996 : Py_XDECREF(order_str);
34997 : Py_XDECREF(py_bytes);
34998 : Py_XDECREF(from_bytes);
34999 : return result;
35000 : #endif
35001 : }
35002 : }
35003 :
35004 : /* CIntFromPy */
35005 0 : static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
35006 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35007 0 : #pragma GCC diagnostic push
35008 0 : #pragma GCC diagnostic ignored "-Wconversion"
35009 : #endif
35010 0 : const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0;
35011 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35012 0 : #pragma GCC diagnostic pop
35013 : #endif
35014 0 : const int is_unsigned = neg_one > const_zero;
35015 : #if PY_MAJOR_VERSION < 3
35016 : if (likely(PyInt_Check(x))) {
35017 : if ((sizeof(npy_uint8) < sizeof(long))) {
35018 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x))
35019 : } else {
35020 : long val = PyInt_AS_LONG(x);
35021 : if (is_unsigned && unlikely(val < 0)) {
35022 : goto raise_neg_overflow;
35023 : }
35024 : return (npy_uint8) val;
35025 : }
35026 : }
35027 : #endif
35028 0 : if (unlikely(!PyLong_Check(x))) {
35029 0 : npy_uint8 val;
35030 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35031 0 : if (!tmp) return (npy_uint8) -1;
35032 0 : val = __Pyx_PyInt_As_npy_uint8(tmp);
35033 0 : Py_DECREF(tmp);
35034 0 : return val;
35035 : }
35036 0 : if (is_unsigned) {
35037 : #if CYTHON_USE_PYLONG_INTERNALS
35038 0 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35039 0 : goto raise_neg_overflow;
35040 0 : } else if (__Pyx_PyLong_IsCompact(x)) {
35041 0 : __PYX_VERIFY_RETURN_INT(npy_uint8, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35042 : } else {
35043 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35044 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35045 0 : switch (__Pyx_PyLong_DigitCount(x)) {
35046 : case 2:
35047 : if ((8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT)) {
35048 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35049 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35050 : } else if ((8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT)) {
35051 : return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
35052 : }
35053 : }
35054 : break;
35055 : case 3:
35056 : if ((8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT)) {
35057 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35058 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35059 : } else if ((8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT)) {
35060 : return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
35061 : }
35062 : }
35063 : break;
35064 0 : case 4:
35065 0 : if ((8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT)) {
35066 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35067 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35068 : } else if ((8 * sizeof(npy_uint8) >= 4 * PyLong_SHIFT)) {
35069 : return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
35070 : }
35071 : }
35072 0 : break;
35073 : }
35074 : }
35075 : #endif
35076 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35077 : if (unlikely(Py_SIZE(x) < 0)) {
35078 : goto raise_neg_overflow;
35079 : }
35080 : #else
35081 0 : {
35082 0 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35083 0 : if (unlikely(result < 0))
35084 : return (npy_uint8) -1;
35085 0 : if (unlikely(result == 1))
35086 0 : goto raise_neg_overflow;
35087 : }
35088 : #endif
35089 0 : if ((sizeof(npy_uint8) <= sizeof(unsigned long))) {
35090 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
35091 : #ifdef HAVE_LONG_LONG
35092 : } else if ((sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG))) {
35093 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35094 : #endif
35095 : }
35096 : } else {
35097 : #if CYTHON_USE_PYLONG_INTERNALS
35098 : if (__Pyx_PyLong_IsCompact(x)) {
35099 : __PYX_VERIFY_RETURN_INT(npy_uint8, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35100 : } else {
35101 : const digit* digits = __Pyx_PyLong_Digits(x);
35102 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35103 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35104 : case -2:
35105 : if ((8 * sizeof(npy_uint8) - 1 > 1 * PyLong_SHIFT)) {
35106 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35107 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35108 : } else if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
35109 : return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
35110 : }
35111 : }
35112 : break;
35113 : case 2:
35114 : if ((8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT)) {
35115 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35116 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35117 : } else if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
35118 : return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
35119 : }
35120 : }
35121 : break;
35122 : case -3:
35123 : if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
35124 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35125 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35126 : } else if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
35127 : return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
35128 : }
35129 : }
35130 : break;
35131 : case 3:
35132 : if ((8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT)) {
35133 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35134 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35135 : } else if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
35136 : return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
35137 : }
35138 : }
35139 : break;
35140 : case -4:
35141 : if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
35142 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35143 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35144 : } else if ((8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT)) {
35145 : return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
35146 : }
35147 : }
35148 : break;
35149 : case 4:
35150 : if ((8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT)) {
35151 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35152 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35153 : } else if ((8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT)) {
35154 : return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
35155 : }
35156 : }
35157 : break;
35158 : }
35159 : }
35160 : #endif
35161 : if ((sizeof(npy_uint8) <= sizeof(long))) {
35162 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x))
35163 : #ifdef HAVE_LONG_LONG
35164 : } else if ((sizeof(npy_uint8) <= sizeof(PY_LONG_LONG))) {
35165 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
35166 : #endif
35167 : }
35168 : }
35169 : {
35170 : npy_uint8 val;
35171 : int ret = -1;
35172 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35173 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35174 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35175 : if (unlikely(bytes_copied == -1)) {
35176 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35177 : goto raise_overflow;
35178 : } else {
35179 : ret = 0;
35180 : }
35181 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35182 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35183 : unsigned char *bytes = (unsigned char *)&val;
35184 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35185 : bytes, sizeof(val),
35186 : is_little, !is_unsigned);
35187 : #else
35188 : PyObject *v;
35189 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35190 : int bits, remaining_bits, is_negative = 0;
35191 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35192 : if (likely(PyLong_CheckExact(x))) {
35193 : v = __Pyx_NewRef(x);
35194 : } else {
35195 : v = PyNumber_Long(x);
35196 : if (unlikely(!v)) return (npy_uint8) -1;
35197 : assert(PyLong_CheckExact(v));
35198 : }
35199 : {
35200 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35201 : if (unlikely(result < 0)) {
35202 : Py_DECREF(v);
35203 : return (npy_uint8) -1;
35204 : }
35205 : is_negative = result == 1;
35206 : }
35207 : if (is_unsigned && unlikely(is_negative)) {
35208 : Py_DECREF(v);
35209 : goto raise_neg_overflow;
35210 : } else if (is_negative) {
35211 : stepval = PyNumber_Invert(v);
35212 : Py_DECREF(v);
35213 : if (unlikely(!stepval))
35214 : return (npy_uint8) -1;
35215 : } else {
35216 : stepval = v;
35217 : }
35218 : v = NULL;
35219 : val = (npy_uint8) 0;
35220 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35221 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35222 : for (bits = 0; bits < (int) sizeof(npy_uint8) * 8 - chunk_size; bits += chunk_size) {
35223 : PyObject *tmp, *digit;
35224 : long idigit;
35225 : digit = PyNumber_And(stepval, mask);
35226 : if (unlikely(!digit)) goto done;
35227 : idigit = PyLong_AsLong(digit);
35228 : Py_DECREF(digit);
35229 : if (unlikely(idigit < 0)) goto done;
35230 : val |= ((npy_uint8) idigit) << bits;
35231 : tmp = PyNumber_Rshift(stepval, shift);
35232 : if (unlikely(!tmp)) goto done;
35233 : Py_DECREF(stepval); stepval = tmp;
35234 : }
35235 : Py_DECREF(shift); shift = NULL;
35236 : Py_DECREF(mask); mask = NULL;
35237 : {
35238 : long idigit = PyLong_AsLong(stepval);
35239 : if (unlikely(idigit < 0)) goto done;
35240 : remaining_bits = ((int) sizeof(npy_uint8) * 8) - bits - (is_unsigned ? 0 : 1);
35241 : if (unlikely(idigit >= (1L << remaining_bits)))
35242 : goto raise_overflow;
35243 : val |= ((npy_uint8) idigit) << bits;
35244 : }
35245 : if (!is_unsigned) {
35246 : if (unlikely(val & (((npy_uint8) 1) << (sizeof(npy_uint8) * 8 - 1))))
35247 : goto raise_overflow;
35248 : if (is_negative)
35249 : val = ~val;
35250 : }
35251 : ret = 0;
35252 : done:
35253 : Py_XDECREF(shift);
35254 : Py_XDECREF(mask);
35255 : Py_XDECREF(stepval);
35256 : #endif
35257 : if (unlikely(ret))
35258 : return (npy_uint8) -1;
35259 : return val;
35260 : }
35261 0 : raise_overflow:
35262 0 : PyErr_SetString(PyExc_OverflowError,
35263 : "value too large to convert to npy_uint8");
35264 0 : return (npy_uint8) -1;
35265 0 : raise_neg_overflow:
35266 0 : PyErr_SetString(PyExc_OverflowError,
35267 : "can't convert negative value to npy_uint8");
35268 0 : return (npy_uint8) -1;
35269 : }
35270 :
35271 : /* CIntFromPy */
35272 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
35273 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35274 0 : #pragma GCC diagnostic push
35275 0 : #pragma GCC diagnostic ignored "-Wconversion"
35276 : #endif
35277 0 : const long neg_one = (long) -1, const_zero = (long) 0;
35278 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35279 0 : #pragma GCC diagnostic pop
35280 : #endif
35281 0 : const int is_unsigned = neg_one > const_zero;
35282 : #if PY_MAJOR_VERSION < 3
35283 : if (likely(PyInt_Check(x))) {
35284 : if ((sizeof(long) < sizeof(long))) {
35285 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
35286 : } else {
35287 : long val = PyInt_AS_LONG(x);
35288 : if (is_unsigned && unlikely(val < 0)) {
35289 : goto raise_neg_overflow;
35290 : }
35291 : return (long) val;
35292 : }
35293 : }
35294 : #endif
35295 0 : if (unlikely(!PyLong_Check(x))) {
35296 0 : long val;
35297 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35298 0 : if (!tmp) return (long) -1;
35299 0 : val = __Pyx_PyInt_As_long(tmp);
35300 0 : Py_DECREF(tmp);
35301 0 : return val;
35302 : }
35303 0 : if (is_unsigned) {
35304 : #if CYTHON_USE_PYLONG_INTERNALS
35305 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35306 : goto raise_neg_overflow;
35307 : } else if (__Pyx_PyLong_IsCompact(x)) {
35308 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35309 : } else {
35310 : const digit* digits = __Pyx_PyLong_Digits(x);
35311 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35312 : switch (__Pyx_PyLong_DigitCount(x)) {
35313 : case 2:
35314 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
35315 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35316 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35317 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
35318 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35319 : }
35320 : }
35321 : break;
35322 : case 3:
35323 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
35324 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35325 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35326 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
35327 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35328 : }
35329 : }
35330 : break;
35331 : case 4:
35332 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
35333 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35334 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35335 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
35336 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35337 : }
35338 : }
35339 : break;
35340 : }
35341 : }
35342 : #endif
35343 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35344 : if (unlikely(Py_SIZE(x) < 0)) {
35345 : goto raise_neg_overflow;
35346 : }
35347 : #else
35348 : {
35349 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35350 : if (unlikely(result < 0))
35351 : return (long) -1;
35352 : if (unlikely(result == 1))
35353 : goto raise_neg_overflow;
35354 : }
35355 : #endif
35356 : if ((sizeof(long) <= sizeof(unsigned long))) {
35357 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
35358 : #ifdef HAVE_LONG_LONG
35359 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
35360 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35361 : #endif
35362 : }
35363 : } else {
35364 : #if CYTHON_USE_PYLONG_INTERNALS
35365 0 : if (__Pyx_PyLong_IsCompact(x)) {
35366 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35367 : } else {
35368 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35369 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35370 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35371 0 : case -2:
35372 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
35373 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35374 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35375 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
35376 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35377 : }
35378 : }
35379 : break;
35380 0 : case 2:
35381 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
35382 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35383 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35384 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
35385 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35386 : }
35387 : }
35388 : break;
35389 : case -3:
35390 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
35391 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35392 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35393 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
35394 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35395 : }
35396 : }
35397 : break;
35398 : case 3:
35399 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
35400 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35401 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35402 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
35403 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35404 : }
35405 : }
35406 : break;
35407 : case -4:
35408 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
35409 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35410 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35411 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
35412 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35413 : }
35414 : }
35415 : break;
35416 : case 4:
35417 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
35418 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35419 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35420 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
35421 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35422 : }
35423 : }
35424 : break;
35425 : }
35426 : }
35427 : #endif
35428 0 : if ((sizeof(long) <= sizeof(long))) {
35429 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
35430 : #ifdef HAVE_LONG_LONG
35431 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
35432 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
35433 : #endif
35434 : }
35435 : }
35436 : {
35437 : long val;
35438 : int ret = -1;
35439 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35440 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35441 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35442 : if (unlikely(bytes_copied == -1)) {
35443 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35444 : goto raise_overflow;
35445 : } else {
35446 : ret = 0;
35447 : }
35448 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35449 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35450 : unsigned char *bytes = (unsigned char *)&val;
35451 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35452 : bytes, sizeof(val),
35453 : is_little, !is_unsigned);
35454 : #else
35455 : PyObject *v;
35456 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35457 : int bits, remaining_bits, is_negative = 0;
35458 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35459 : if (likely(PyLong_CheckExact(x))) {
35460 : v = __Pyx_NewRef(x);
35461 : } else {
35462 : v = PyNumber_Long(x);
35463 : if (unlikely(!v)) return (long) -1;
35464 : assert(PyLong_CheckExact(v));
35465 : }
35466 : {
35467 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35468 : if (unlikely(result < 0)) {
35469 : Py_DECREF(v);
35470 : return (long) -1;
35471 : }
35472 : is_negative = result == 1;
35473 : }
35474 : if (is_unsigned && unlikely(is_negative)) {
35475 : Py_DECREF(v);
35476 : goto raise_neg_overflow;
35477 : } else if (is_negative) {
35478 : stepval = PyNumber_Invert(v);
35479 : Py_DECREF(v);
35480 : if (unlikely(!stepval))
35481 : return (long) -1;
35482 : } else {
35483 : stepval = v;
35484 : }
35485 : v = NULL;
35486 : val = (long) 0;
35487 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35488 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35489 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
35490 : PyObject *tmp, *digit;
35491 : long idigit;
35492 : digit = PyNumber_And(stepval, mask);
35493 : if (unlikely(!digit)) goto done;
35494 : idigit = PyLong_AsLong(digit);
35495 : Py_DECREF(digit);
35496 : if (unlikely(idigit < 0)) goto done;
35497 : val |= ((long) idigit) << bits;
35498 : tmp = PyNumber_Rshift(stepval, shift);
35499 : if (unlikely(!tmp)) goto done;
35500 : Py_DECREF(stepval); stepval = tmp;
35501 : }
35502 : Py_DECREF(shift); shift = NULL;
35503 : Py_DECREF(mask); mask = NULL;
35504 : {
35505 : long idigit = PyLong_AsLong(stepval);
35506 : if (unlikely(idigit < 0)) goto done;
35507 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
35508 : if (unlikely(idigit >= (1L << remaining_bits)))
35509 : goto raise_overflow;
35510 : val |= ((long) idigit) << bits;
35511 : }
35512 : if (!is_unsigned) {
35513 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
35514 : goto raise_overflow;
35515 : if (is_negative)
35516 : val = ~val;
35517 : }
35518 : ret = 0;
35519 : done:
35520 : Py_XDECREF(shift);
35521 : Py_XDECREF(mask);
35522 : Py_XDECREF(stepval);
35523 : #endif
35524 : if (unlikely(ret))
35525 : return (long) -1;
35526 : return val;
35527 : }
35528 : raise_overflow:
35529 : PyErr_SetString(PyExc_OverflowError,
35530 : "value too large to convert to long");
35531 : return (long) -1;
35532 : raise_neg_overflow:
35533 : PyErr_SetString(PyExc_OverflowError,
35534 : "can't convert negative value to long");
35535 : return (long) -1;
35536 : }
35537 :
35538 : /* CIntToPy */
35539 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
35540 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35541 0 : #pragma GCC diagnostic push
35542 0 : #pragma GCC diagnostic ignored "-Wconversion"
35543 : #endif
35544 0 : const long neg_one = (long) -1, const_zero = (long) 0;
35545 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35546 0 : #pragma GCC diagnostic pop
35547 : #endif
35548 0 : const int is_unsigned = neg_one > const_zero;
35549 0 : if (is_unsigned) {
35550 : if (sizeof(long) < sizeof(long)) {
35551 : return PyInt_FromLong((long) value);
35552 : } else if (sizeof(long) <= sizeof(unsigned long)) {
35553 : return PyLong_FromUnsignedLong((unsigned long) value);
35554 : #ifdef HAVE_LONG_LONG
35555 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
35556 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35557 : #endif
35558 : }
35559 : } else {
35560 0 : if (sizeof(long) <= sizeof(long)) {
35561 0 : return PyInt_FromLong((long) value);
35562 : #ifdef HAVE_LONG_LONG
35563 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
35564 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35565 : #endif
35566 : }
35567 : }
35568 : {
35569 : unsigned char *bytes = (unsigned char *)&value;
35570 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35571 : if (is_unsigned) {
35572 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35573 : } else {
35574 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35575 : }
35576 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35577 : int one = 1; int little = (int)*(unsigned char *)&one;
35578 : return _PyLong_FromByteArray(bytes, sizeof(long),
35579 : little, !is_unsigned);
35580 : #else
35581 : int one = 1; int little = (int)*(unsigned char *)&one;
35582 : PyObject *from_bytes, *result = NULL;
35583 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35584 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35585 : if (!from_bytes) return NULL;
35586 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
35587 : if (!py_bytes) goto limited_bad;
35588 : order_str = PyUnicode_FromString(little ? "little" : "big");
35589 : if (!order_str) goto limited_bad;
35590 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35591 : if (!arg_tuple) goto limited_bad;
35592 : if (!is_unsigned) {
35593 : kwds = PyDict_New();
35594 : if (!kwds) goto limited_bad;
35595 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35596 : }
35597 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35598 : limited_bad:
35599 : Py_XDECREF(kwds);
35600 : Py_XDECREF(arg_tuple);
35601 : Py_XDECREF(order_str);
35602 : Py_XDECREF(py_bytes);
35603 : Py_XDECREF(from_bytes);
35604 : return result;
35605 : #endif
35606 : }
35607 : }
35608 :
35609 : /* CIntFromPy */
35610 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
35611 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35612 : #pragma GCC diagnostic push
35613 : #pragma GCC diagnostic ignored "-Wconversion"
35614 : #endif
35615 : const char neg_one = (char) -1, const_zero = (char) 0;
35616 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35617 : #pragma GCC diagnostic pop
35618 : #endif
35619 : const int is_unsigned = neg_one > const_zero;
35620 : #if PY_MAJOR_VERSION < 3
35621 : if (likely(PyInt_Check(x))) {
35622 : if ((sizeof(char) < sizeof(long))) {
35623 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
35624 : } else {
35625 : long val = PyInt_AS_LONG(x);
35626 : if (is_unsigned && unlikely(val < 0)) {
35627 : goto raise_neg_overflow;
35628 : }
35629 : return (char) val;
35630 : }
35631 : }
35632 : #endif
35633 : if (unlikely(!PyLong_Check(x))) {
35634 : char val;
35635 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35636 : if (!tmp) return (char) -1;
35637 : val = __Pyx_PyInt_As_char(tmp);
35638 : Py_DECREF(tmp);
35639 : return val;
35640 : }
35641 : if (is_unsigned) {
35642 : #if CYTHON_USE_PYLONG_INTERNALS
35643 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35644 : goto raise_neg_overflow;
35645 : } else if (__Pyx_PyLong_IsCompact(x)) {
35646 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35647 : } else {
35648 : const digit* digits = __Pyx_PyLong_Digits(x);
35649 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35650 : switch (__Pyx_PyLong_DigitCount(x)) {
35651 : case 2:
35652 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
35653 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35654 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35655 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
35656 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
35657 : }
35658 : }
35659 : break;
35660 : case 3:
35661 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
35662 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35663 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35664 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
35665 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
35666 : }
35667 : }
35668 : break;
35669 : case 4:
35670 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
35671 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35672 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35673 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
35674 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
35675 : }
35676 : }
35677 : break;
35678 : }
35679 : }
35680 : #endif
35681 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35682 : if (unlikely(Py_SIZE(x) < 0)) {
35683 : goto raise_neg_overflow;
35684 : }
35685 : #else
35686 : {
35687 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35688 : if (unlikely(result < 0))
35689 : return (char) -1;
35690 : if (unlikely(result == 1))
35691 : goto raise_neg_overflow;
35692 : }
35693 : #endif
35694 : if ((sizeof(char) <= sizeof(unsigned long))) {
35695 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
35696 : #ifdef HAVE_LONG_LONG
35697 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
35698 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35699 : #endif
35700 : }
35701 : } else {
35702 : #if CYTHON_USE_PYLONG_INTERNALS
35703 : if (__Pyx_PyLong_IsCompact(x)) {
35704 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35705 : } else {
35706 : const digit* digits = __Pyx_PyLong_Digits(x);
35707 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35708 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35709 : case -2:
35710 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
35711 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35712 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35713 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
35714 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
35715 : }
35716 : }
35717 : break;
35718 : case 2:
35719 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
35720 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35721 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35722 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
35723 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
35724 : }
35725 : }
35726 : break;
35727 : case -3:
35728 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
35729 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35730 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35731 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
35732 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
35733 : }
35734 : }
35735 : break;
35736 : case 3:
35737 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
35738 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35739 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35740 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
35741 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
35742 : }
35743 : }
35744 : break;
35745 : case -4:
35746 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
35747 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35748 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35749 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
35750 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
35751 : }
35752 : }
35753 : break;
35754 : case 4:
35755 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
35756 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35757 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35758 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
35759 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
35760 : }
35761 : }
35762 : break;
35763 : }
35764 : }
35765 : #endif
35766 : if ((sizeof(char) <= sizeof(long))) {
35767 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
35768 : #ifdef HAVE_LONG_LONG
35769 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
35770 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
35771 : #endif
35772 : }
35773 : }
35774 : {
35775 : char val;
35776 : int ret = -1;
35777 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35778 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35779 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35780 : if (unlikely(bytes_copied == -1)) {
35781 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35782 : goto raise_overflow;
35783 : } else {
35784 : ret = 0;
35785 : }
35786 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35787 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35788 : unsigned char *bytes = (unsigned char *)&val;
35789 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35790 : bytes, sizeof(val),
35791 : is_little, !is_unsigned);
35792 : #else
35793 : PyObject *v;
35794 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35795 : int bits, remaining_bits, is_negative = 0;
35796 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35797 : if (likely(PyLong_CheckExact(x))) {
35798 : v = __Pyx_NewRef(x);
35799 : } else {
35800 : v = PyNumber_Long(x);
35801 : if (unlikely(!v)) return (char) -1;
35802 : assert(PyLong_CheckExact(v));
35803 : }
35804 : {
35805 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35806 : if (unlikely(result < 0)) {
35807 : Py_DECREF(v);
35808 : return (char) -1;
35809 : }
35810 : is_negative = result == 1;
35811 : }
35812 : if (is_unsigned && unlikely(is_negative)) {
35813 : Py_DECREF(v);
35814 : goto raise_neg_overflow;
35815 : } else if (is_negative) {
35816 : stepval = PyNumber_Invert(v);
35817 : Py_DECREF(v);
35818 : if (unlikely(!stepval))
35819 : return (char) -1;
35820 : } else {
35821 : stepval = v;
35822 : }
35823 : v = NULL;
35824 : val = (char) 0;
35825 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35826 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35827 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
35828 : PyObject *tmp, *digit;
35829 : long idigit;
35830 : digit = PyNumber_And(stepval, mask);
35831 : if (unlikely(!digit)) goto done;
35832 : idigit = PyLong_AsLong(digit);
35833 : Py_DECREF(digit);
35834 : if (unlikely(idigit < 0)) goto done;
35835 : val |= ((char) idigit) << bits;
35836 : tmp = PyNumber_Rshift(stepval, shift);
35837 : if (unlikely(!tmp)) goto done;
35838 : Py_DECREF(stepval); stepval = tmp;
35839 : }
35840 : Py_DECREF(shift); shift = NULL;
35841 : Py_DECREF(mask); mask = NULL;
35842 : {
35843 : long idigit = PyLong_AsLong(stepval);
35844 : if (unlikely(idigit < 0)) goto done;
35845 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
35846 : if (unlikely(idigit >= (1L << remaining_bits)))
35847 : goto raise_overflow;
35848 : val |= ((char) idigit) << bits;
35849 : }
35850 : if (!is_unsigned) {
35851 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
35852 : goto raise_overflow;
35853 : if (is_negative)
35854 : val = ~val;
35855 : }
35856 : ret = 0;
35857 : done:
35858 : Py_XDECREF(shift);
35859 : Py_XDECREF(mask);
35860 : Py_XDECREF(stepval);
35861 : #endif
35862 : if (unlikely(ret))
35863 : return (char) -1;
35864 : return val;
35865 : }
35866 : raise_overflow:
35867 : PyErr_SetString(PyExc_OverflowError,
35868 : "value too large to convert to char");
35869 : return (char) -1;
35870 : raise_neg_overflow:
35871 : PyErr_SetString(PyExc_OverflowError,
35872 : "can't convert negative value to char");
35873 : return (char) -1;
35874 : }
35875 :
35876 : /* FormatTypeName */
35877 : #if CYTHON_COMPILING_IN_LIMITED_API
35878 : static __Pyx_TypeName
35879 : __Pyx_PyType_GetName(PyTypeObject* tp)
35880 : {
35881 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
35882 : __pyx_n_s_name_2);
35883 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
35884 : PyErr_Clear();
35885 : Py_XDECREF(name);
35886 : name = __Pyx_NewRef(__pyx_n_s__28);
35887 : }
35888 : return name;
35889 : }
35890 : #endif
35891 :
35892 : /* CheckBinaryVersion */
35893 1 : static unsigned long __Pyx_get_runtime_version(void) {
35894 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
35895 1 : return Py_Version & ~0xFFUL;
35896 : #else
35897 : const char* rt_version = Py_GetVersion();
35898 : unsigned long version = 0;
35899 : unsigned long factor = 0x01000000UL;
35900 : unsigned int digit = 0;
35901 : int i = 0;
35902 : while (factor) {
35903 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
35904 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
35905 : ++i;
35906 : }
35907 : version += factor * digit;
35908 : if (rt_version[i] != '.')
35909 : break;
35910 : digit = 0;
35911 : factor >>= 8;
35912 : ++i;
35913 : }
35914 : return version;
35915 : #endif
35916 : }
35917 1 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
35918 1 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
35919 1 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
35920 : return 0;
35921 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
35922 : return 1;
35923 0 : {
35924 0 : char message[200];
35925 0 : PyOS_snprintf(message, sizeof(message),
35926 : "compile time Python version %d.%d "
35927 : "of module '%.100s' "
35928 : "%s "
35929 : "runtime version %d.%d",
35930 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
35931 : __Pyx_MODULE_NAME,
35932 : (allow_newer) ? "was newer than" : "does not match",
35933 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
35934 : );
35935 0 : return PyErr_WarnEx(NULL, message, 1);
35936 : }
35937 : }
35938 :
35939 : /* InitStrings */
35940 : #if PY_MAJOR_VERSION >= 3
35941 245 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
35942 245 : if (t.is_unicode | t.is_str) {
35943 242 : if (t.intern) {
35944 182 : *str = PyUnicode_InternFromString(t.s);
35945 60 : } else if (t.encoding) {
35946 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
35947 : } else {
35948 60 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
35949 : }
35950 : } else {
35951 3 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
35952 : }
35953 245 : if (!*str)
35954 : return -1;
35955 245 : if (PyObject_Hash(*str) == -1)
35956 : return -1;
35957 : return 0;
35958 : }
35959 : #endif
35960 1 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
35961 246 : while (t->p) {
35962 : #if PY_MAJOR_VERSION >= 3
35963 245 : __Pyx_InitString(*t, t->p);
35964 : #else
35965 : if (t->is_unicode) {
35966 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
35967 : } else if (t->intern) {
35968 : *t->p = PyString_InternFromString(t->s);
35969 : } else {
35970 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
35971 : }
35972 : if (!*t->p)
35973 : return -1;
35974 : if (PyObject_Hash(*t->p) == -1)
35975 : return -1;
35976 : #endif
35977 245 : ++t;
35978 : }
35979 1 : return 0;
35980 : }
35981 :
35982 : #include <string.h>
35983 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
35984 0 : size_t len = strlen(s);
35985 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
35986 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
35987 : return -1;
35988 : }
35989 : return (Py_ssize_t) len;
35990 : }
35991 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
35992 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
35993 : if (unlikely(len < 0)) return NULL;
35994 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
35995 : }
35996 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
35997 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
35998 : if (unlikely(len < 0)) return NULL;
35999 : return PyByteArray_FromStringAndSize(c_str, len);
36000 : }
36001 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
36002 : Py_ssize_t ignore;
36003 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
36004 : }
36005 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36006 : #if !CYTHON_PEP393_ENABLED
36007 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36008 : char* defenc_c;
36009 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
36010 : if (!defenc) return NULL;
36011 : defenc_c = PyBytes_AS_STRING(defenc);
36012 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36013 : {
36014 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
36015 : char* c;
36016 : for (c = defenc_c; c < end; c++) {
36017 : if ((unsigned char) (*c) >= 128) {
36018 : PyUnicode_AsASCIIString(o);
36019 : return NULL;
36020 : }
36021 : }
36022 : }
36023 : #endif
36024 : *length = PyBytes_GET_SIZE(defenc);
36025 : return defenc_c;
36026 : }
36027 : #else
36028 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36029 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
36030 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36031 : if (likely(PyUnicode_IS_ASCII(o))) {
36032 : *length = PyUnicode_GET_LENGTH(o);
36033 : return PyUnicode_AsUTF8(o);
36034 : } else {
36035 : PyUnicode_AsASCIIString(o);
36036 : return NULL;
36037 : }
36038 : #else
36039 : return PyUnicode_AsUTF8AndSize(o, length);
36040 : #endif
36041 : }
36042 : #endif
36043 : #endif
36044 6973 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36045 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36046 : if (
36047 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36048 : __Pyx_sys_getdefaultencoding_not_ascii &&
36049 : #endif
36050 : PyUnicode_Check(o)) {
36051 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
36052 : } else
36053 : #endif
36054 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36055 6973 : if (PyByteArray_Check(o)) {
36056 0 : *length = PyByteArray_GET_SIZE(o);
36057 0 : return PyByteArray_AS_STRING(o);
36058 : } else
36059 : #endif
36060 : {
36061 6973 : char* result;
36062 6973 : int r = PyBytes_AsStringAndSize(o, &result, length);
36063 6973 : if (unlikely(r < 0)) {
36064 : return NULL;
36065 : } else {
36066 6973 : return result;
36067 : }
36068 : }
36069 : }
36070 28949 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
36071 28949 : int is_true = x == Py_True;
36072 28949 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36073 1 : else return PyObject_IsTrue(x);
36074 : }
36075 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
36076 : int retval;
36077 : if (unlikely(!x)) return -1;
36078 : retval = __Pyx_PyObject_IsTrue(x);
36079 : Py_DECREF(x);
36080 : return retval;
36081 : }
36082 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
36083 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
36084 : #if PY_MAJOR_VERSION >= 3
36085 0 : if (PyLong_Check(result)) {
36086 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
36087 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
36088 : "The ability to return an instance of a strict subclass of int is deprecated, "
36089 : "and may be removed in a future version of Python.",
36090 : result_type_name)) {
36091 0 : __Pyx_DECREF_TypeName(result_type_name);
36092 0 : Py_DECREF(result);
36093 0 : return NULL;
36094 : }
36095 : __Pyx_DECREF_TypeName(result_type_name);
36096 : return result;
36097 : }
36098 : #endif
36099 0 : PyErr_Format(PyExc_TypeError,
36100 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
36101 : type_name, type_name, result_type_name);
36102 0 : __Pyx_DECREF_TypeName(result_type_name);
36103 0 : Py_DECREF(result);
36104 : return NULL;
36105 : }
36106 12 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36107 : #if CYTHON_USE_TYPE_SLOTS
36108 12 : PyNumberMethods *m;
36109 : #endif
36110 12 : const char *name = NULL;
36111 12 : PyObject *res = NULL;
36112 : #if PY_MAJOR_VERSION < 3
36113 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
36114 : #else
36115 12 : if (likely(PyLong_Check(x)))
36116 : #endif
36117 12 : return __Pyx_NewRef(x);
36118 : #if CYTHON_USE_TYPE_SLOTS
36119 0 : m = Py_TYPE(x)->tp_as_number;
36120 : #if PY_MAJOR_VERSION < 3
36121 : if (m && m->nb_int) {
36122 : name = "int";
36123 : res = m->nb_int(x);
36124 : }
36125 : else if (m && m->nb_long) {
36126 : name = "long";
36127 : res = m->nb_long(x);
36128 : }
36129 : #else
36130 0 : if (likely(m && m->nb_int)) {
36131 0 : name = "int";
36132 0 : res = m->nb_int(x);
36133 : }
36134 : #endif
36135 : #else
36136 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
36137 : res = PyNumber_Int(x);
36138 : }
36139 : #endif
36140 0 : if (likely(res)) {
36141 : #if PY_MAJOR_VERSION < 3
36142 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
36143 : #else
36144 0 : if (unlikely(!PyLong_CheckExact(res))) {
36145 : #endif
36146 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36147 : }
36148 : }
36149 0 : else if (!PyErr_Occurred()) {
36150 0 : PyErr_SetString(PyExc_TypeError,
36151 : "an integer is required");
36152 : }
36153 : return res;
36154 : }
36155 8686 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
36156 8686 : Py_ssize_t ival;
36157 8686 : PyObject *x;
36158 : #if PY_MAJOR_VERSION < 3
36159 : if (likely(PyInt_CheckExact(b))) {
36160 : if (sizeof(Py_ssize_t) >= sizeof(long))
36161 : return PyInt_AS_LONG(b);
36162 : else
36163 : return PyInt_AsSsize_t(b);
36164 : }
36165 : #endif
36166 8686 : if (likely(PyLong_CheckExact(b))) {
36167 : #if CYTHON_USE_PYLONG_INTERNALS
36168 8686 : if (likely(__Pyx_PyLong_IsCompact(b))) {
36169 8686 : return __Pyx_PyLong_CompactValue(b);
36170 : } else {
36171 0 : const digit* digits = __Pyx_PyLong_Digits(b);
36172 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
36173 0 : switch (size) {
36174 0 : case 2:
36175 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36176 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36177 : }
36178 : break;
36179 0 : case -2:
36180 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36181 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36182 : }
36183 : break;
36184 : case 3:
36185 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36186 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36187 : }
36188 : break;
36189 : case -3:
36190 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36191 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36192 : }
36193 : break;
36194 : case 4:
36195 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36196 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36197 : }
36198 : break;
36199 : case -4:
36200 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36201 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36202 : }
36203 : break;
36204 : }
36205 : }
36206 : #endif
36207 0 : return PyLong_AsSsize_t(b);
36208 : }
36209 0 : x = PyNumber_Index(b);
36210 0 : if (!x) return -1;
36211 0 : ival = PyInt_AsSsize_t(x);
36212 0 : Py_DECREF(x);
36213 : return ival;
36214 : }
36215 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
36216 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
36217 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
36218 : #if PY_MAJOR_VERSION < 3
36219 : } else if (likely(PyInt_CheckExact(o))) {
36220 : return PyInt_AS_LONG(o);
36221 : #endif
36222 : } else {
36223 : Py_ssize_t ival;
36224 : PyObject *x;
36225 : x = PyNumber_Index(o);
36226 : if (!x) return -1;
36227 : ival = PyInt_AsLong(x);
36228 : Py_DECREF(x);
36229 : return ival;
36230 : }
36231 : }
36232 19747 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
36233 19747 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
36234 : }
36235 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36236 : return PyInt_FromSize_t(ival);
36237 : }
36238 :
36239 :
36240 : /* #### Code section: utility_code_pragmas_end ### */
36241 : #ifdef _MSC_VER
36242 : #pragma warning( pop )
36243 : #endif
36244 :
36245 :
36246 :
36247 : /* #### Code section: end ### */
36248 : #endif /* Py_PYTHON_H */
|